From 768b190b10e61932d78547e44aa9475ae950e409 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Tue, 22 May 2018 20:00:22 +0000
Subject: [PATCH] Minor fix: warning-message if in labels class_id >= classes in cfg-file
---
src/yolo_layer.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/yolo_layer.c b/src/yolo_layer.c
index 87dedae..c1309c8 100644
--- a/src/yolo_layer.c
+++ b/src/yolo_layer.c
@@ -201,7 +201,10 @@
for(t = 0; t < l.max_boxes; ++t){
box truth = float_to_box_stride(state.truth + t*(4 + 1) + b*l.truths, 1);
int class_id = state.truth[t*(4 + 1) + b*l.truths + 4];
- if (class_id >= l.classes) continue; // if label contains class_id more than number of classes in the cfg-file
+ if (class_id >= l.classes) {
+ printf("Warning: in txt-labels class_id=%d >= classes=%d in cfg-file\n", class_id, l.classes);
+ continue; // if label contains class_id more than number of classes in the cfg-file
+ }
if(!truth.x) break;
float iou = box_iou(pred, truth);
if (iou > best_iou) {
--
Gitblit v1.10.0