Unverified Commit 23f20c2e authored by ChaimZhu's avatar ChaimZhu Committed by GitHub
Browse files

clean unnecessary custom_imports (#1068)

parent 0cd000bf
...@@ -62,10 +62,6 @@ def main(): ...@@ -62,10 +62,6 @@ def main():
cfg = Config.fromfile(args.config) cfg = Config.fromfile(args.config)
if args.cfg_options is not None: if args.cfg_options is not None:
cfg.merge_from_dict(args.cfg_options) cfg.merge_from_dict(args.cfg_options)
# import modules from string list.
if cfg.get('custom_imports', None):
from mmcv.utils import import_modules_from_strings
import_modules_from_strings(**cfg['custom_imports'])
model = build_model( model = build_model(
cfg.model, cfg.model,
......
...@@ -55,10 +55,6 @@ def build_data_cfg(config_path, skip_type, cfg_options): ...@@ -55,10 +55,6 @@ def build_data_cfg(config_path, skip_type, cfg_options):
cfg = Config.fromfile(config_path) cfg = Config.fromfile(config_path)
if cfg_options is not None: if cfg_options is not None:
cfg.merge_from_dict(cfg_options) cfg.merge_from_dict(cfg_options)
# import modules from string list.
if cfg.get('custom_imports', None):
from mmcv.utils import import_modules_from_strings
import_modules_from_strings(**cfg['custom_imports'])
# extract inner dataset of `RepeatDataset` as `cfg.data.train` # extract inner dataset of `RepeatDataset` as `cfg.data.train`
# so we don't need to worry about it later # so we don't need to worry about it later
if cfg.data.train['type'] == 'RepeatDataset': if cfg.data.train['type'] == 'RepeatDataset':
......
...@@ -117,10 +117,6 @@ def main(): ...@@ -117,10 +117,6 @@ def main():
cfg = Config.fromfile(args.config) cfg = Config.fromfile(args.config)
if args.cfg_options is not None: if args.cfg_options is not None:
cfg.merge_from_dict(args.cfg_options) cfg.merge_from_dict(args.cfg_options)
# import modules from string list.
if cfg.get('custom_imports', None):
from mmcv.utils import import_modules_from_strings
import_modules_from_strings(**cfg['custom_imports'])
# set cudnn_benchmark # set cudnn_benchmark
if cfg.get('cudnn_benchmark', False): if cfg.get('cudnn_benchmark', False):
torch.backends.cudnn.benchmark = True torch.backends.cudnn.benchmark = True
......
...@@ -97,10 +97,6 @@ def main(): ...@@ -97,10 +97,6 @@ def main():
cfg = Config.fromfile(args.config) cfg = Config.fromfile(args.config)
if args.cfg_options is not None: if args.cfg_options is not None:
cfg.merge_from_dict(args.cfg_options) cfg.merge_from_dict(args.cfg_options)
# import modules from string list.
if cfg.get('custom_imports', None):
from mmcv.utils import import_modules_from_strings
import_modules_from_strings(**cfg['custom_imports'])
# set cudnn_benchmark # set cudnn_benchmark
if cfg.get('cudnn_benchmark', False): if cfg.get('cudnn_benchmark', False):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment