Skip to content
Snippets Groups Projects
Unverified Commit 5ea21f24 authored by Qian Zhao's avatar Qian Zhao Committed by GitHub
Browse files

[Fix] Fix hub.get_model failure on some mmcls models (#784)

parent 7e787d8f
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,8 @@ def get_model(cfg_path: str, pretrained: bool = False, **kwargs):
package = cfg_path.split('::')[0]
with DefaultScope.overwrite_default_scope(package): # type: ignore
cfg = get_config(cfg_path, pretrained)
if 'data_preprocessor' in cfg:
cfg.model.data_preprocessor = cfg.data_preprocessor
models_module = importlib.import_module(f'{package}.utils')
models_module.register_all_modules() # type: ignore
model = MODELS.build(cfg.model, default_args=kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment