From ecd723a18f31ed12b31b1cc07e67db8ea110b8e5 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Sun, 13 Oct 2019 12:23:28 +0800 Subject: [PATCH] refine assert info in roidb_source.py (#3536) * refine assert info in roidb_source.py * refine image_dir assert --- .../PaddleDetection/ppdet/data/source/roidb_source.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PaddleCV/PaddleDetection/ppdet/data/source/roidb_source.py b/PaddleCV/PaddleDetection/ppdet/data/source/roidb_source.py index be4d10b1..5eeb08c1 100644 --- a/PaddleCV/PaddleDetection/ppdet/data/source/roidb_source.py +++ b/PaddleCV/PaddleDetection/ppdet/data/source/roidb_source.py @@ -59,13 +59,13 @@ class RoiDbSource(Dataset): """ super(RoiDbSource, self).__init__() self._epoch = -1 - assert os.path.isfile(anno_file) or os.path.isdir( - anno_file), 'invalid file[%s] for RoiDbSource' % (anno_file) + assert os.path.isfile(anno_file) or os.path.isdir(anno_file), \ + 'anno_file {} is not a file or a directory'.format(anno_file) self._fname = anno_file self._image_dir = image_dir if image_dir is not None: - assert os.path.isdir(image_dir), 'invalid image directory[%s]' % ( - image_dir) + assert os.path.isdir(image_dir), \ + 'image_dir {} is not a directory'.format(image_dir) self._roidb = None self._pos = -1 self._drained = False -- GitLab