diff --git a/mmdet/utils/misc.py b/mmdet/utils/misc.py index cf6ff690efb..4113672acfb 100644 --- a/mmdet/utils/misc.py +++ b/mmdet/utils/misc.py @@ -52,18 +52,15 @@ def update_data_root(cfg, logger=None): cfg (mmcv.Config): The model config need to modify logger (logging.Logger | str | None): the way to print msg """ - assert isinstance(cfg, mmcv.Config), \ + assert isinstance(cfg, mmcv.Config), \ f'cfg got wrong type: {type(cfg)}, expected mmcv.Config' - - if 'MMDET_DATASETS' in os.environ: - dst_root = os.environ['MMDET_DATASETS'] - print_log(f'MMDET_DATASETS has been set to be {dst_root}. \ - Using {dst_root} as data root.') - return - else: + + if 'MMDET_DATASETS' in os.environ: dst_root = os.environ['MMDET_DATASETS'] - print_log(f'MMDET_DATASETS has been set to be {dst_root}. \ - Using {dst_root} as datat root.') + print_log(f'MMDET_DATASETS has been set to be {dst_root}.' + f'Using {dst_root} as data root.') + else: + return assert isinstance(cfg, mmcv.Config), \ f'cfg got wrong type: {type(cfg)}, expected mmcv.Config'