From 4f72fb40aa92fe07822dc0ff8c1320a3e0d388ab Mon Sep 17 00:00:00 2001 From: Wenyu Date: Thu, 18 Mar 2021 09:44:28 +0800 Subject: [PATCH] fix errors of usage and some names (#2352) Co-authored-by: Kaipeng Deng --- dygraph/ppdet/data/source/dataset.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dygraph/ppdet/data/source/dataset.py b/dygraph/ppdet/data/source/dataset.py index 66c32b881..429cdc7a5 100644 --- a/dygraph/ppdet/data/source/dataset.py +++ b/dygraph/ppdet/data/source/dataset.py @@ -79,7 +79,7 @@ class DetDataset(Dataset): self._epoch = epoch_id def parse_dataset(self, ): - raise NotImplemented( + raise NotImplementedError( "Need to implement parse_dataset method of Dataset") def get_anno(self): @@ -94,13 +94,13 @@ def _is_valid_file(f, extensions=('.jpg', '.jpeg', '.png', '.bmp')): def _make_dataset(dir): dir = os.path.expanduser(dir) - if not os.path.isdir(d): + if not os.path.isdir(dir): raise ('{} should be a dir'.format(dir)) images = [] for root, _, fnames in sorted(os.walk(dir, followlinks=True)): for fname in sorted(fnames): path = os.path.join(root, fname) - if is_valid_file(path): + if _is_valid_file(path): images.append(path) return images -- GitLab