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

@KalenMike
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-06-29 12:44:59 +02:00
1 parent 02719dde52
commit 3213d8713f
1 file changed
+1 -1
+1 -1
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 = []