From c52fa4742866125e35e88d0653dac99473e5fffb Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Mon, 16 Apr 2018 13:09:10 +0300 Subject: [PATCH] Loss-graph store automatically (iterations == max_batches) at the end of training --- src/convolutional_layer.c | 2 +- src/detector.c | 2 +- src/image.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/convolutional_layer.c b/src/convolutional_layer.c index cd369292..91c5b3c0 100644 --- a/src/convolutional_layer.c +++ b/src/convolutional_layer.c @@ -248,7 +248,7 @@ void cudnn_convolutional_setup(layer *l, int cudnn_preference) //printf("Tensor Cores - Backward-filter enabled: l->bf_algo = CUDNN_CONVOLUTION_BWD_FILTER_ALGO_WINOGRAD_NONFUSED \n"); if (fw == 2 && bd == 2 && bf == 2) printf("TF "); - else if (fw >= 1 && bd >= 1 && bf >= 1) printf("TH "); + else if (fw == 1 && bd == 1 && bf == 1) printf("TH "); } } #endif diff --git a/src/detector.c b/src/detector.c index e4687beb..c5afae51 100644 --- a/src/detector.c +++ b/src/detector.c @@ -99,7 +99,7 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i args.hue = net.hue; #ifdef OPENCV - args.threads = 7; + args.threads = 3; IplImage* img = NULL; float max_img_loss = 5; int number_of_lines = 100; diff --git a/src/image.c b/src/image.c index 4821eff1..61f760a0 100644 --- a/src/image.c +++ b/src/image.c @@ -572,7 +572,7 @@ void draw_train_loss(IplImage* img, int img_size, float avg_loss, float max_img_ cvPutText(img, char_buff, pt1, &font, CV_RGB(0, 0, 0)); cvShowImage("average loss", img); int k = cvWaitKey(20); - if (k == 's') cvSaveImage("chart.jpg", img, 0); + if (k == 's' || current_batch == (max_batches-1)) cvSaveImage("chart.jpg", img, 0); } #endif // OPENCV