From 38841c3bb090851559bb64049d85389410f248d5 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Mon, 16 Sep 2019 18:08:43 +0800 Subject: [PATCH] refine auto download logs (#3330) * refine auto download logs --- PaddleCV/PaddleDetection/ppdet/utils/download.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/PaddleCV/PaddleDetection/ppdet/utils/download.py b/PaddleCV/PaddleDetection/ppdet/utils/download.py index 2b283d0c..def4c4d9 100644 --- a/PaddleCV/PaddleDetection/ppdet/utils/download.py +++ b/PaddleCV/PaddleDetection/ppdet/utils/download.py @@ -81,7 +81,7 @@ def get_dataset_path(path, annotation, image_dir): if _dataset_exists(path, annotation, image_dir): return path - logger.info("Dataset {} not exists, try searching {} or " + logger.info("Dataset {} is not valid for reason above, try searching {} or " "downloading dataset...".format( osp.realpath(path), DATASET_HOME)) @@ -125,7 +125,9 @@ def get_dataset_path(path, annotation, image_dir): return data_dir # not match any dataset in DATASETS - raise ValueError("{} not exists or unknow dataset type".format(path)) + raise ValueError("Dataset {} is not valid and cannot parse dataset type " + "'{}' for automaticly downloading, which only supports " + "'voc' and 'coco' currently".format(path, osp.split(path)[-1])) def get_path(url, root_dir, md5sum=None): @@ -171,20 +173,23 @@ def _dataset_exists(path, annotation, image_dir): Check if user define dataset exists """ if not osp.exists(path): - logger.info("Config dataset_dir {} not exits".format(path)) + logger.info("Config dataset_dir {} is not exits, " + "dataset config is not valid".format(path)) return False if annotation: annotation_path = osp.join(path, annotation) if not osp.isfile(annotation_path): logger.info("Config annotation {} is not a " - "file".format(annotation_path)) + "file, dataset config is not " + "valid".format(annotation_path)) return False if image_dir: image_path = osp.join(path, image_dir) if not osp.isdir(image_path): logger.info("Config image_dir {} is not a " - "directory".format(image_path)) + "directory, dataset config is not " + "valid".format(image_path)) return False return True -- GitLab