From 73768ef6e3ee3647e198022300a9e0a7e751ef5b Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Fri, 15 May 2020 18:52:20 +0300 Subject: [PATCH] Added [net] max_chart_loss=50 for scale y-axis of Loss-chart --- include/darknet.h | 1 + src/classifier.c | 2 +- src/detector.c | 2 +- src/parser.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/darknet.h b/include/darknet.h index b6b21d85..bee9bd9a 100644 --- a/include/darknet.h +++ b/include/darknet.h @@ -711,6 +711,7 @@ typedef struct network { int attention; int adversarial; float adversarial_lr; + float max_chart_loss; int letter_box; float angle; float aspect; diff --git a/src/classifier.c b/src/classifier.c index cdffef5b..5fc37af6 100644 --- a/src/classifier.c +++ b/src/classifier.c @@ -116,7 +116,7 @@ void train_classifier(char *datacfg, char *cfgfile, char *weightfile, int *gpus, #ifdef OPENCV //args.threads = 3; mat_cv* img = NULL; - float max_img_loss = 10; + float max_img_loss = net.max_chart_loss; int number_of_lines = 100; int img_size = 1000; char windows_name[100]; diff --git a/src/detector.c b/src/detector.c index 2ea4b17d..18b46002 100644 --- a/src/detector.c +++ b/src/detector.c @@ -154,7 +154,7 @@ void train_detector(char *datacfg, char *cfgfile, char *weightfile, int *gpus, i args.threads = 6 * ngpus; // 3 for - Amazon EC2 Tesla V100: p3.2xlarge (8 logical cores) - p3.16xlarge //args.threads = 12 * ngpus; // Ryzen 7 2700X (16 logical cores) mat_cv* img = NULL; - float max_img_loss = 5; + float max_img_loss = net.max_chart_loss; int number_of_lines = 100; int img_size = 1000; char windows_name[100]; diff --git a/src/parser.c b/src/parser.c index 1fa85fd0..7738359f 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1118,6 +1118,7 @@ void parse_net_options(list *options, network *net) net->resize_step = option_find_float_quiet(options, "resize_step", 32); net->attention = option_find_int_quiet(options, "attention", 0); net->adversarial_lr = option_find_float_quiet(options, "adversarial_lr", 0); + net->max_chart_loss = option_find_float_quiet(options, "max_chart_loss", 5.0); net->angle = option_find_float_quiet(options, "angle", 0); net->aspect = option_find_float_quiet(options, "aspect", 1);