diff --git a/ppdet/data/source/roidb_source.py b/ppdet/data/source/roidb_source.py index be4d10b17f544072bb7679205e75891677a24e6b..5eeb08c1a06f13cad2ab2c6f5e82d5a04ab32182 100644 --- a/ppdet/data/source/roidb_source.py +++ b/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