diff --git a/ppdet/utils/download.py b/ppdet/utils/download.py index 2b283d0c12a3254b3aa0c46abd5f9c9942fbcc6f..def4c4d9a353939d5a110812fb929a9889490330 100644 --- a/ppdet/utils/download.py +++ b/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