Skip to content

Commit

Permalink
Change hook_cfg type access to hook_cfg.get() (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
lorinczszabolcs authored and fangyixiao18 committed Sep 30, 2022
1 parent aa3343c commit 3f80791
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmselfsup/apis/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3f80791

Please sign in to comment.