From 2b8638d1d6fdf4b17276594c8c0eb35fdbe0652d Mon Sep 17 00:00:00 2001 From: Wenyu Date: Thu, 18 Mar 2021 09:43:58 +0800 Subject: [PATCH] fix errors of usage and some names (#2351) --- 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