Fix for `dataset_stats()` with updated data.yaml (#3819)

@KalenMike
pull/3820/head
Glenn Jocher 2021-06-29 12:44:59 +02:00 committed by GitHub
parent 02719dde52
commit 3213d8713f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1116,7 +1116,7 @@ def dataset_stats(path='coco128.yaml', autodownload=False, verbose=False):
nc = data['nc'] # number of classes
stats = {'nc': nc, 'names': data['names']} # statistics dictionary
for split in 'train', 'val', 'test':
if split not in data:
if data.get(split) is None:
stats[split] = None # i.e. no test set
continue
x = []