From 909144d725ee67eec6af4ab694b34d4a1f4bf8b0 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 29 Jun 2021 12:44:59 +0200 Subject: [PATCH] Fix for `dataset_stats()` with updated data.yaml (#3819) @KalenMike --- utils/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index 4658dc524be0..c2859a148106 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -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 = []