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

This commit is contained in:
Lőrincz-Molnár Szabolcs-Botond 2022-08-09 10:53:12 +03:00 committed by Yixiao Fang
parent e826153b2d
commit a0087327da

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()