Change hook_cfg type access to hook_cfg.get() (#409)

pull/520/head
Lőrincz-Molnár Szabolcs-Botond 2022-08-09 10:53:12 +03:00 committed by Yixiao Fang
parent e826153b2d
commit a0087327da
1 changed files with 1 additions and 1 deletions

View File

@ -170,7 +170,7 @@ def train_model(model,
assert isinstance(hook_cfg, dict), \
'Each item in custom_hooks expects dict type, but got ' \
f'{type(hook_cfg)}'
if hook_cfg.type == 'DeepClusterHook':
if hook_cfg.get('type', None) == 'DeepClusterHook':
common_params = dict(dist_mode=True, data_loaders=data_loaders)
else:
common_params = dict()