Skip to content

Commit

Permalink
Register DistSamplerSeedHook for EpochBasedRunner only
Browse files Browse the repository at this point in the history
Co-authored-by: Ma Zerun <mzr1996@163.com>
  • Loading branch information
youqingxiaozhua and mzr1996 authored Oct 27, 2021
1 parent 94b6609 commit 2169cb5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmcls/apis/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def train_model(model,
cfg.log_config,
cfg.get('momentum_config', None),
custom_hooks_config=cfg.get('custom_hooks', None))
if distributed and cfg.runner['type'] != 'IterBasedRunner':
if distributed and cfg.runner['type'] == 'EpochBasedRunner':
runner.register_hook(DistSamplerSeedHook())

# register eval hooks
Expand Down

0 comments on commit 2169cb5

Please sign in to comment.