From 80d9bec20f0a44ab07616215c6eadb2d633492fe Mon Sep 17 00:00:00 2001 From: Joseph Redmon Date: Sun, 26 Nov 2017 12:27:21 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=83=20=F0=9F=A4=94=20=F0=9F=92=AD=20?= =?UTF-8?q?=F0=9F=91=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/nightmare.c | 6 +++--- src/convolutional_kernels.cu | 2 +- src/parser.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/nightmare.c b/examples/nightmare.c index be2179e4..71d38334 100644 --- a/examples/nightmare.c +++ b/examples/nightmare.c @@ -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); diff --git a/src/convolutional_kernels.cu b/src/convolutional_kernels.cu index 45242a1c..56043e78 100644 --- a/src/convolutional_kernels.cu +++ b/src/convolutional_kernels.cu @@ -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); diff --git a/src/parser.c b/src/parser.c index 14914bc9..da7487b0 100644 --- a/src/parser.c +++ b/src/parser.c @@ -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;