Headers are important

This commit is contained in:
Joseph Redmon 2015-08-01 17:26:53 -07:00
parent 0b4c38f631
commit f11480833d
6 changed files with 8 additions and 5 deletions

View File

@ -110,13 +110,12 @@ void train_coco(char *cfgfile, char *weightfile)
save_weights(net, buff); save_weights(net, buff);
return; return;
} }
if(i%1000==0 || 1){ if(i%1000==0){
char buff[256]; char buff[256];
sprintf(buff, "%s/%s_%d.weights", backup_directory, base, i); sprintf(buff, "%s/%s_%d.weights", backup_directory, base, i);
save_weights(net, buff); save_weights(net, buff);
} }
free_data(train); free_data(train);
return;
} }
char buff[256]; char buff[256];
sprintf(buff, "%s/%s_final.weights", backup_directory, base); sprintf(buff, "%s/%s_final.weights", backup_directory, base);

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
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) int row, int col, int channel, int pad, float val)
{ {
row -= pad; row -= pad;

View File

@ -1,6 +1,6 @@
#include "im2col.h" #include "im2col.h"
#include <stdio.h> #include <stdio.h>
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) int row, int col, int channel, int pad)
{ {
row -= pad; row -= pad;

View File

@ -47,7 +47,7 @@ void train_imagenet(char *cfgfile, char *weightfile)
avg_loss = avg_loss*.9 + loss*.1; 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); printf("%d: %f, %f avg, %lf seconds, %d images\n", i, loss, avg_loss, sec(clock()-time), net.seen);
free_data(train); free_data(train);
if((i % 35000) == 0) net.learning_rate *= .1; if((i % 30000) == 0) net.learning_rate *= .1;
if(i%1000==0){ if(i%1000==0){
char buff[256]; char buff[256];
sprintf(buff, "/home/pjreddie/imagenet_backup/%s_%d.weights",base, i); sprintf(buff, "/home/pjreddie/imagenet_backup/%s_%d.weights",base, i);

View File

@ -4,6 +4,7 @@
#include "image.h" #include "image.h"
#include "data.h" #include "data.h"
#include "utils.h" #include "utils.h"
#include "blas.h"
#include "crop_layer.h" #include "crop_layer.h"
#include "connected_layer.h" #include "connected_layer.h"

View File

@ -236,6 +236,9 @@ dropout_layer parse_dropout(list *options, size_params params)
{ {
float probability = option_find_float(options, "probability", .5); float probability = option_find_float(options, "probability", .5);
dropout_layer layer = make_dropout_layer(params.batch, params.inputs, probability); 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; return layer;
} }