From bcc085d83f1883c6e29969c7dd62c1296fcd80fa Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 5 Nov 2021 13:32:46 +0100 Subject: [PATCH] Common `is_coco` logic betwen train.py and val.py (#5521) --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index f827d985c..75f3b7cb3 100644 --- a/train.py +++ b/train.py @@ -107,7 +107,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary nc = 1 if single_cls else int(data_dict['nc']) # number of classes names = ['item'] if single_cls and len(data_dict['names']) != 1 else data_dict['names'] # class names assert len(names) == nc, f'{len(names)} names found for nc={nc} dataset in {data}' # check - is_coco = data.endswith('coco.yaml') and nc == 80 # COCO dataset + is_coco = isinstance(val_path, str) and val_path.endswith('coco/val2017.txt') # COCO dataset # Model check_suffix(weights, '.pt') # check weights