Skip to content

Commit

Permalink
Fix for dataset_stats() with updated data.yaml (ultralytics#3819)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Jun 29, 2021
1 parent 2a8d9fb commit 909144d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ def round_labels(labels):
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 = []
Expand Down

0 comments on commit 909144d

Please sign in to comment.