🌃 🤔 💭 👹

This commit is contained in:
Joseph Redmon 2017-11-26 12:27:21 -08:00
parent 56be49aa48
commit 80d9bec20f
3 changed files with 5 additions and 5 deletions

View File

@ -47,7 +47,7 @@ void optimize_picture(network *net, image orig, int max_layer, float scale, floa
#ifdef GPU
net->delta_gpu = cuda_make_array(delta.data, im.w*im.h*im.c);
cuda_push_array(net->input_gpu, im.data, net->inputs);
copy_cpu(net->inputs, im.data, 1, net->input, 1);
forward_network_gpu(net);
copy_gpu(last.outputs, last.output_gpu, 1, last.delta_gpu, 1);
@ -62,6 +62,7 @@ void optimize_picture(network *net, image orig, int max_layer, float scale, floa
cuda_free(net->delta_gpu);
net->delta_gpu = 0;
#else
printf("\nnet: %d %d %d im: %d %d %d\n", net->w, net->h, net->inputs, im.w, im.h, im.c);
copy_cpu(net->inputs, im.data, 1, net->input, 1);
net->delta = delta.data;
forward_network(net);
@ -308,8 +309,7 @@ void run_nightmare(int argc, char **argv)
int reconstruct = find_arg(argc, argv, "-reconstruct");
int smooth_size = find_int_arg(argc, argv, "-smooth", 1);
network *net = parse_network_cfg(cfg);
load_weights(net, weights);
network *net = load_network(cfg, weights, 0);
char *cfgbase = basecfg(cfg);
char *imbase = basecfg(input);

View File

@ -177,7 +177,7 @@ void backward_convolutional_layer_gpu(convolutional_layer l, network net)
if(l.smooth){
smooth_layer(l, 5, l.smooth);
}
constrain_gpu(l.outputs*l.batch, 1, l.delta_gpu, 1);
//constrain_gpu(l.outputs*l.batch, 1, l.delta_gpu, 1);
gradient_array_gpu(l.output_gpu, l.outputs*l.batch, l.activation, l.delta_gpu);

View File

@ -1110,7 +1110,7 @@ void load_weights_upto(network *net, char *filename, int start, int cutoff)
fread(&major, sizeof(int), 1, fp);
fread(&minor, sizeof(int), 1, fp);
fread(&revision, sizeof(int), 1, fp);
if ((major*10 + minor) >= 2){
if ((major*10 + minor) >= 2 && major < 1000 && minor < 1000){
fread(net->seen, sizeof(size_t), 1, fp);
} else {
int iseen = 0;