Browse Source

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

@KalenMike
modifyDataloader
Glenn Jocher GitHub 3 years ago
parent
commit
3213d8713f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      utils/datasets.py

+ 1
- 1
utils/datasets.py 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 = []

Loading…
Cancel
Save