From 1cb5eed089875fd813901104ba0b034c0ee11c81 Mon Sep 17 00:00:00 2001 From: cnn Date: Thu, 24 Sep 2020 16:45:40 +0800 Subject: [PATCH] judge dataset file_path exists (#1488) --- ppdet/utils/download.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ppdet/utils/download.py b/ppdet/utils/download.py index 8af0be07b..cc78e4753 100644 --- a/ppdet/utils/download.py +++ b/ppdet/utils/download.py @@ -239,13 +239,19 @@ def _dataset_exists(path, annotation, image_dir): if annotation: annotation_path = osp.join(path, annotation) + if not osp.exists(annotation_path): + logger.error("Config dataset_dir {} is not exits!".format(path)) + if not osp.isfile(annotation_path): - logger.debug("Config annotation {} is not a " - "file, dataset config is not " - "valid".format(annotation_path)) + logger.warning("Config annotation {} is not a " + "file, dataset config is not " + "valid".format(annotation_path)) return False if image_dir: image_path = osp.join(path, image_dir) + if not osp.exists(image_path): + logger.warning("Config dataset_dir {} is not exits!".format(path)) + if not osp.isdir(image_path): logger.warning("Config image_dir {} is not a " "directory, dataset config is not " -- GitLab