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
ModelZoo
ResNet50_tensorflow
Commits
680eb35c
Unverified
Commit
680eb35c
authored
Jul 02, 2019
by
Yuefeng Zhou
Committed by
GitHub
Jul 02, 2019
Browse files
Allow distibution_utils.py to worker with PSStrategy or none strategy (#7135)
when there are multiple workers.
parent
58a3de6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/utils/misc/distribution_utils.py
official/utils/misc/distribution_utils.py
+2
-2
No files found.
official/utils/misc/distribution_utils.py
View file @
680eb35c
...
@@ -114,13 +114,13 @@ def get_distribution_strategy(distribution_strategy="default",
...
@@ -114,13 +114,13 @@ def get_distribution_strategy(distribution_strategy="default",
distribution_strategy
=
distribution_strategy
.
lower
()
distribution_strategy
=
distribution_strategy
.
lower
()
if
distribution_strategy
==
"off"
:
if
distribution_strategy
==
"off"
:
if
num_gpus
>
1
or
num_workers
>
1
:
if
num_gpus
>
1
:
raise
ValueError
(
raise
ValueError
(
"When {} GPUs and {} workers are specified, distribution_strategy "
"When {} GPUs and {} workers are specified, distribution_strategy "
"flag cannot be set to 'off'."
.
format
(
num_gpus
,
num_workers
))
"flag cannot be set to 'off'."
.
format
(
num_gpus
,
num_workers
))
return
None
return
None
if
distribution_strategy
==
"multi_worker_mirrored"
or
num_workers
>
1
:
if
distribution_strategy
==
"multi_worker_mirrored"
:
return
tf
.
distribute
.
experimental
.
MultiWorkerMirroredStrategy
(
return
tf
.
distribute
.
experimental
.
MultiWorkerMirroredStrategy
(
communication
=
_collective_communication
(
all_reduce_alg
))
communication
=
_collective_communication
(
all_reduce_alg
))
...
...
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