From f11480833d19c0a7e9e1f7b45a19ba5bb5d63666 Mon Sep 17 00:00:00 2001 From: Joseph Redmon Date: Sat, 1 Aug 2015 17:26:53 -0700 Subject: [PATCH] Headers are important --- src/coco.c | 3 +-- src/col2im.c | 2 +- src/im2col.c | 2 +- src/imagenet.c | 2 +- src/network.c | 1 + src/parser.c | 3 +++ 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/coco.c b/src/coco.c index af76eccb..3f74be7d 100644 --- a/src/coco.c +++ b/src/coco.c @@ -110,13 +110,12 @@ void train_coco(char *cfgfile, char *weightfile) save_weights(net, buff); return; } - if(i%1000==0 || 1){ + if(i%1000==0){ char buff[256]; sprintf(buff, "%s/%s_%d.weights", backup_directory, base, i); save_weights(net, buff); } free_data(train); - return; } char buff[256]; sprintf(buff, "%s/%s_final.weights", backup_directory, base); diff --git a/src/col2im.c b/src/col2im.c index 0fb3db41..d63a1e0b 100644 --- a/src/col2im.c +++ b/src/col2im.c @@ -1,6 +1,6 @@ #include #include -inline void col2im_add_pixel(float *im, int height, int width, int channels, +void col2im_add_pixel(float *im, int height, int width, int channels, int row, int col, int channel, int pad, float val) { row -= pad; diff --git a/src/im2col.c b/src/im2col.c index 6970c553..1ff45c8c 100644 --- a/src/im2col.c +++ b/src/im2col.c @@ -1,6 +1,6 @@ #include "im2col.h" #include -inline float im2col_get_pixel(float *im, int height, int width, int channels, +float im2col_get_pixel(float *im, int height, int width, int channels, int row, int col, int channel, int pad) { row -= pad; diff --git a/src/imagenet.c b/src/imagenet.c index 8682e6a2..96e74d0a 100644 --- a/src/imagenet.c +++ b/src/imagenet.c @@ -47,7 +47,7 @@ void train_imagenet(char *cfgfile, char *weightfile) avg_loss = avg_loss*.9 + loss*.1; printf("%d: %f, %f avg, %lf seconds, %d images\n", i, loss, avg_loss, sec(clock()-time), net.seen); free_data(train); - if((i % 35000) == 0) net.learning_rate *= .1; + if((i % 30000) == 0) net.learning_rate *= .1; if(i%1000==0){ char buff[256]; sprintf(buff, "/home/pjreddie/imagenet_backup/%s_%d.weights",base, i); diff --git a/src/network.c b/src/network.c index fba44947..ff5cd616 100644 --- a/src/network.c +++ b/src/network.c @@ -4,6 +4,7 @@ #include "image.h" #include "data.h" #include "utils.h" +#include "blas.h" #include "crop_layer.h" #include "connected_layer.h" diff --git a/src/parser.c b/src/parser.c index 5591dc3c..b373c01a 100644 --- a/src/parser.c +++ b/src/parser.c @@ -236,6 +236,9 @@ dropout_layer parse_dropout(list *options, size_params params) { float probability = option_find_float(options, "probability", .5); dropout_layer layer = make_dropout_layer(params.batch, params.inputs, probability); + layer.out_w = params.w; + layer.out_h = params.h; + layer.out_c = params.c; return layer; }