From 100e806e3c8c26eb991b61305ff2afe9f53b4b86 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 7ed8f5a1d805..338400e63406 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -375,7 +375,7 @@ def __init__(self, path, img_size=640, batch_size=16, augment=False, hyp=None, r 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