Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
797ef57e
Unverified
Commit
797ef57e
authored
Jun 27, 2021
by
Jerry Jiarui XU
Committed by
GitHub
Jun 27, 2021
Browse files
[Fix] Fix SyncBN build in PyTorch 1.9 (#1138)
* [Fix] Fix SyncBN build in PyTorch 1.9 * fixed parrots SyncBN
parent
db097bd1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
5 deletions
+1
-5
mmcv/cnn/bricks/norm.py
mmcv/cnn/bricks/norm.py
+1
-1
mmcv/utils/parrots_wrapper.py
mmcv/utils/parrots_wrapper.py
+0
-4
No files found.
mmcv/cnn/bricks/norm.py
View file @
797ef57e
...
...
@@ -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_
...
...
mmcv/utils/parrots_wrapper.py
View file @
797ef57e
...
...
@@ -82,10 +82,6 @@ _AdaptiveAvgPoolNd, _AdaptiveMaxPoolNd, _AvgPoolNd, _MaxPoolNd = _get_pool()
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment