Skip to content

Commit

Permalink
Merge d9af6b0 into 1b15f02
Browse files Browse the repository at this point in the history
  • Loading branch information
xvjiarui authored Jun 25, 2021
2 parents 1b15f02 + d9af6b0 commit 6843309
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion mmcv/cnn/bricks/norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def build_norm_layer(cfg, num_features, postfix=''):
cfg_.setdefault('eps', 1e-5)
if layer_type != 'GN':
layer = norm_layer(num_features, **cfg_)
if layer_type == 'SyncBN':
if layer_type == 'SyncBN' and hasattr(layer, '_specify_ddp_gpu_num'):
layer._specify_ddp_gpu_num(1)
else:
assert 'num_groups' in cfg_
Expand Down
4 changes: 0 additions & 4 deletions mmcv/utils/parrots_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ def _get_norm():

class SyncBatchNorm(SyncBatchNorm_):

def _specify_ddp_gpu_num(self, gpu_size):
if TORCH_VERSION != 'parrots':
super()._specify_ddp_gpu_num(gpu_size)

def _check_input_dim(self, input):
if TORCH_VERSION == 'parrots':
if input.dim() < 2:
Expand Down

0 comments on commit 6843309

Please sign in to comment.