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
b64d4387
Commit
b64d4387
authored
Dec 25, 2018
by
Kai Chen
Browse files
make compatible with pytorch 0.4.1 and 1.0
parent
076cdd6c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
mmcv/parallel/distributed.py
mmcv/parallel/distributed.py
+4
-1
mmcv/runner/utils.py
mmcv/runner/utils.py
+6
-1
mmcv/version.py
mmcv/version.py
+1
-1
No files found.
mmcv/parallel/distributed.py
View file @
b64d4387
...
...
@@ -33,6 +33,9 @@ class MMDistributedDataParallel(nn.Module):
self
.
_dist_broadcast_coalesced
(
module_states
,
self
.
broadcast_bucket_size
)
if
self
.
broadcast_buffers
:
if
torch
.
__version__
<
'1.0'
:
buffers
=
[
b
.
data
for
b
in
self
.
module
.
_all_buffers
()]
else
:
buffers
=
[
b
.
data
for
b
in
self
.
module
.
buffers
()]
if
len
(
buffers
)
>
0
:
self
.
_dist_broadcast_coalesced
(
buffers
,
...
...
mmcv/runner/utils.py
View file @
b64d4387
...
...
@@ -5,6 +5,7 @@ from getpass import getuser
from
socket
import
gethostname
import
mmcv
import
torch
import
torch.distributed
as
dist
...
...
@@ -13,7 +14,11 @@ def get_host_info():
def
get_dist_info
():
if
dist
.
is_initialized
():
if
torch
.
__version__
<
'1.0'
:
initialized
=
dist
.
_initialized
else
:
initialized
=
dist
.
is_initialized
()
if
initialized
:
rank
=
dist
.
get_rank
()
world_size
=
dist
.
get_world_size
()
else
:
...
...
mmcv/version.py
View file @
b64d4387
__version__
=
'0.2.
2
'
__version__
=
'0.2.
3
'
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