From f9bab6b12761015b8bda6625c9bb8ec7ac35ec78 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 9 Jul 2020 13:36:23 -0700 Subject: [PATCH] Update datasets.py --- utils/datasets.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/utils/datasets.py b/utils/datasets.py index d3bc574..0d8852c 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -295,16 +295,11 @@ class LoadImagesAndLabels(Dataset): # for training/testing else: raise Exception('%s does not exist' % subpath) self.img_files = [x.replace('/', os.sep) for x in f if os.path.splitext(x)[-1].lower() in img_formats] + path = subpath except: # Maybe avoid handling bare exceptions raise Exception('Error loading data from %s. See %s' % (path, help_url)) - # Still need to do this for compatibility with the .npy and shape file saves - if isinstance(path, list): - path = str(Path(path[0])) - else: - path = str(Path(path)) - n = len(self.img_files) assert n > 0, 'No images found in %s. See %s' % (path, help_url) bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index