it's raining really hard outside :-( :rain: :storm: ☁️

This commit is contained in:
Joseph Redmon
2017-10-17 11:41:34 -07:00
parent 532c6e1481
commit cd5d393b46
27 changed files with 1340 additions and 1669 deletions

View File

@ -8,14 +8,10 @@ void train_super(char *cfgfile, char *weightfile, int clear)
char *base = basecfg(cfgfile);
printf("%s\n", base);
float avg_loss = -1;
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
}
if(clear) *net.seen = 0;
printf("Learning Rate: %g, Momentum: %g, Decay: %g\n", net.learning_rate, net.momentum, net.decay);
int imgs = net.batch*net.subdivisions;
int i = *net.seen/imgs;
network *net = load_network(cfgfile, weightfile, clear);
printf("Learning Rate: %g, Momentum: %g, Decay: %g\n", net->learning_rate, net->momentum, net->decay);
int imgs = net->batch*net->subdivisions;
int i = *net->seen/imgs;
data train, buffer;
@ -24,8 +20,8 @@ void train_super(char *cfgfile, char *weightfile, int clear)
char **paths = (char **)list_to_array(plist);
load_args args = {0};
args.w = net.w;
args.h = net.h;
args.w = net->w;
args.h = net->h;
args.scale = 4;
args.paths = paths;
args.n = imgs;
@ -36,7 +32,7 @@ void train_super(char *cfgfile, char *weightfile, int clear)
pthread_t load_thread = load_data_in_thread(args);
clock_t time;
//while(i*imgs < N*120){
while(get_current_batch(net) < net.max_batches){
while(get_current_batch(net) < net->max_batches){
i += 1;
time=clock();
pthread_join(load_thread, 0);
@ -70,11 +66,8 @@ void train_super(char *cfgfile, char *weightfile, int clear)
void test_super(char *cfgfile, char *weightfile, char *filename)
{
network net = parse_network_cfg(cfgfile);
if(weightfile){
load_weights(&net, weightfile);
}
set_batch_network(&net, 1);
network *net = load_network(cfgfile, weightfile, 0);
set_batch_network(net, 1);
srand(2222222);
clock_t time;
@ -91,7 +84,7 @@ void test_super(char *cfgfile, char *weightfile, char *filename)
strtok(input, "\n");
}
image im = load_image_color(input, 0, 0);
resize_network(&net, im.w, im.h);
resize_network(net, im.w, im.h);
printf("%d %d\n", im.w, im.h);
float *X = im.data;