From 593b6b9e3e688953b904087c574cffc37e4e92e2 Mon Sep 17 00:00:00 2001 From: cnn Date: Sat, 19 Sep 2020 21:03:51 +0800 Subject: [PATCH] judge dataset file_path exists (#1438) --- 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