From 542833c99759b727899182a2bfe2ae7a80be2d5a Mon Sep 17 00:00:00 2001 From: tkianai <49858938+tkianai@users.noreply.github.com> Date: Wed, 12 Aug 2020 02:15:48 +0800 Subject: [PATCH] Filter the None labels (#705) * the value should be a list to unpacking * filter the None labels --- utils/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index 7ed8f5a..338400e 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -375,7 +375,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing pbar = tqdm(self.label_files) for i, file in enumerate(pbar): l = self.labels[i] # label - if l.shape[0]: + if l is not None and l.shape[0]: assert l.shape[1] == 5, '> 5 label columns: %s' % file assert (l >= 0).all(), 'negative labels: %s' % file assert (l[:, 1:] <= 1).all(), 'non-normalized or out of bounds coordinate labels: %s' % file