Skip to content

Commit bcc085d

Browse files
authored
Common is_coco logic betwen train.py and val.py (#5521)
1 parent bfacfc6 commit bcc085d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
107107
nc = 1 if single_cls else int(data_dict['nc']) # number of classes
108108
names = ['item'] if single_cls and len(data_dict['names']) != 1 else data_dict['names'] # class names
109109
assert len(names) == nc, f'{len(names)} names found for nc={nc} dataset in {data}' # check
110-
is_coco = data.endswith('coco.yaml') and nc == 80 # COCO dataset
110+
is_coco = isinstance(val_path, str) and val_path.endswith('coco/val2017.txt') # COCO dataset
111111

112112
# Model
113113
check_suffix(weights, '.pt') # check weights

0 commit comments

Comments
 (0)