From 4b0fb0c8f40db54801722c2f5ab718ba02e6aa89 Mon Sep 17 00:00:00 2001 From: Joaquin Alori Date: Wed, 18 Apr 2018 16:34:42 -0300 Subject: [PATCH] Add class number error checking to eval script --- luminoth/eval.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/luminoth/eval.py b/luminoth/eval.py index 172d0ed8..976eeea9 100644 --- a/luminoth/eval.py +++ b/luminoth/eval.py @@ -428,6 +428,14 @@ def evaluate_once(config, writer, saver, ops, checkpoint, ) ) + assert len(ap_per_class) == len(class_labels), ( + "Model built using {} classes but dataset used in eval has {}" + " classes. Did you forget to define the number of classes in" + " your config .yml file?".format( + len(ap_per_class), len(class_labels) + ) + ) + for idx, val in enumerate(ap_per_class[:, 0]): class_label = '{} ({})'.format( class_labels[idx], idx