Skip to content

Commit 9dafa46

Browse files
authored
fix norm sync bug (#6852)
tigger bug when model not exist BN layer.
1 parent 83eea4b commit 9dafa46

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mmdet/core/hook/sync_norm_hook.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,7 @@ def after_train_epoch(self, runner):
4646
if world_size == 1:
4747
return
4848
norm_states = get_norm_states(module)
49+
if len(norm_states) == 0:
50+
return
4951
norm_states = all_reduce_dict(norm_states, op='mean')
5052
module.load_state_dict(norm_states, strict=False)

0 commit comments

Comments
 (0)