From c0d6b81a78e204c04c9bf4277974e0dadad0c4e2 Mon Sep 17 00:00:00 2001 From: AlexeyAB Date: Sat, 23 May 2020 17:52:20 +0300 Subject: [PATCH] yolov4.cfg is fixed for stable training without Nan --- build/darknet/x64/cfg/yolov4.cfg | 5 ++++- cfg/yolov4.cfg | 5 ++++- src/layer.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build/darknet/x64/cfg/yolov4.cfg b/build/darknet/x64/cfg/yolov4.cfg index 47b9db61..a7be12b3 100644 --- a/build/darknet/x64/cfg/yolov4.cfg +++ b/build/darknet/x64/cfg/yolov4.cfg @@ -14,7 +14,7 @@ saturation = 1.5 exposure = 1.5 hue=.1 -learning_rate=0.00261 +learning_rate=0.0013 burn_in=1000 max_batches = 500500 policy=steps @@ -977,6 +977,7 @@ iou_normalizer=0.07 iou_loss=ciou nms_kind=greedynms beta_nms=0.6 +max_delta=5 [route] @@ -1064,6 +1065,7 @@ iou_normalizer=0.07 iou_loss=ciou nms_kind=greedynms beta_nms=0.6 +max_delta=5 [route] @@ -1152,4 +1154,5 @@ iou_normalizer=0.07 iou_loss=ciou nms_kind=greedynms beta_nms=0.6 +max_delta=5 diff --git a/cfg/yolov4.cfg b/cfg/yolov4.cfg index 47b9db61..a7be12b3 100644 --- a/cfg/yolov4.cfg +++ b/cfg/yolov4.cfg @@ -14,7 +14,7 @@ saturation = 1.5 exposure = 1.5 hue=.1 -learning_rate=0.00261 +learning_rate=0.0013 burn_in=1000 max_batches = 500500 policy=steps @@ -977,6 +977,7 @@ iou_normalizer=0.07 iou_loss=ciou nms_kind=greedynms beta_nms=0.6 +max_delta=5 [route] @@ -1064,6 +1065,7 @@ iou_normalizer=0.07 iou_loss=ciou nms_kind=greedynms beta_nms=0.6 +max_delta=5 [route] @@ -1152,4 +1154,5 @@ iou_normalizer=0.07 iou_loss=ciou nms_kind=greedynms beta_nms=0.6 +max_delta=5 diff --git a/src/layer.c b/src/layer.c index a459f9d0..19e26402 100644 --- a/src/layer.c +++ b/src/layer.c @@ -188,7 +188,7 @@ void free_layer_custom(layer l, int keep_cudnn_desc) if (l.scale_updates_gpu) cuda_free(l.scale_updates_gpu), l.scale_updates_gpu = NULL; if (l.input_antialiasing_gpu) cuda_free(l.input_antialiasing_gpu), l.input_antialiasing_gpu = NULL; if (l.optimized_memory < 2) { - if (l.x_gpu) cuda_free(l.x_gpu); l.x_gpu = NULL; + if (l.x_gpu) cuda_free(l.x_gpu), l.x_gpu = NULL; if (l.output_gpu) cuda_free(l.output_gpu), l.output_gpu = NULL; if (l.output_avg_gpu) cuda_free(l.output_avg_gpu), l.output_avg_gpu = NULL; if (l.activation_input_gpu) cuda_free(l.activation_input_gpu), l.activation_input_gpu = NULL;