shortcut_layer resize for random=1

This commit is contained in:
AlexeyAB
2018-03-16 01:49:01 +03:00
parent df076653e0
commit 371f21171a
5 changed files with 32 additions and 5 deletions

View File

@ -43,6 +43,9 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i
float avg_loss = -1;
network *nets = calloc(ngpus, sizeof(network));
int iter_save;
iter_save = 100;
srand(time(0));
int seed = rand();
int i;
@ -89,7 +92,7 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i
args.small_object = l.small_object;
args.d = &buffer;
args.type = DETECTION_DATA;
args.threads = 4;// 8;
args.threads = 8; // 64
args.angle = net.angle;
args.exposure = net.exposure;
@ -113,7 +116,6 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i
if(l.random && count++%10 == 0){
printf("Resizing\n");
int dim = (rand() % 12 + (init_w/32 - 5)) * 32; // +-160
//int dim = (rand() % 10 + 10) * 32;
//if (get_current_batch(net)+100 > net.max_batches) dim = 544;
//int dim = (rand() % 4 + 16) * 32;
printf("%d\n", dim);
@ -177,7 +179,9 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i
#endif // OPENCV
//if (i % 1000 == 0 || (i < 1000 && i % 100 == 0)) {
if (i % 100 == 0) {
//if (i % 100 == 0) {
if(i >= iter_save) {
iter_save += 100;
#ifdef GPU
if (ngpus != 1) sync_nets(nets, ngpus, 0);
#endif