From 8eced539e022c10d9037bea496f0a709e4af7393 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 20 May 2019 14:52:14 +0200 Subject: [PATCH] updates --- utils/datasets.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/datasets.py b/utils/datasets.py index db2ac998..912c91a7 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -195,7 +195,9 @@ class LoadImagesAndLabels(Dataset): # for training/testing try: with open(file, 'r') as f: self.labels[i] = np.array([x.split() for x in f.read().splitlines()], dtype=np.float32) + assert self.labels[i].shape[1] == 5, 'corrupted labels file: %s' % file except: + print('Warning: missing labels for %s' % self.img_files[i]) pass # missing label file def __len__(self):