glenn-jocher commited on
Commit
3213d87
1 Parent(s): 02719dd

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

Browse files
Files changed (1) hide show
  1. utils/datasets.py +1 -1
utils/datasets.py CHANGED
@@ -1116,7 +1116,7 @@ def dataset_stats(path='coco128.yaml', autodownload=False, verbose=False):
1116
  nc = data['nc'] # number of classes
1117
  stats = {'nc': nc, 'names': data['names']} # statistics dictionary
1118
  for split in 'train', 'val', 'test':
1119
- if split not in data:
1120
  stats[split] = None # i.e. no test set
1121
  continue
1122
  x = []
 
1116
  nc = data['nc'] # number of classes
1117
  stats = {'nc': nc, 'names': data['names']} # statistics dictionary
1118
  for split in 'train', 'val', 'test':
1119
+ if data.get(split) is None:
1120
  stats[split] = None # i.e. no test set
1121
  continue
1122
  x = []