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
161ebfc7
Commit
161ebfc7
authored
Mar 08, 2021
by
Yeqing Li
Committed by
A. Unique TensorFlower
Mar 08, 2021
Browse files
Fixes the type of the ParameterServerStrategy.
PiperOrigin-RevId: 361587168
parent
196f09ae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
official/common/distribute_utils.py
official/common/distribute_utils.py
+3
-1
No files found.
official/common/distribute_utils.py
View file @
161ebfc7
...
@@ -170,7 +170,8 @@ def get_distribution_strategy(distribution_strategy="mirrored",
...
@@ -170,7 +170,8 @@ def get_distribution_strategy(distribution_strategy="mirrored",
cross_device_ops
=
_mirrored_cross_device_ops
(
all_reduce_alg
,
num_packs
))
cross_device_ops
=
_mirrored_cross_device_ops
(
all_reduce_alg
,
num_packs
))
if
distribution_strategy
==
"parameter_server"
:
if
distribution_strategy
==
"parameter_server"
:
return
tf
.
compat
.
v1
.
distribute
.
experimental
.
ParameterServerStrategy
()
cluster_resolver
=
tf
.
distribute
.
cluster_resolver
.
TFConfigClusterResolver
()
return
tf
.
distribute
.
experimental
.
ParameterServerStrategy
(
cluster_resolver
)
raise
ValueError
(
"Unrecognized Distribution Strategy: %r"
%
raise
ValueError
(
"Unrecognized Distribution Strategy: %r"
%
distribution_strategy
)
distribution_strategy
)
...
@@ -181,6 +182,7 @@ def configure_cluster(worker_hosts=None, task_index=-1):
...
@@ -181,6 +182,7 @@ def configure_cluster(worker_hosts=None, task_index=-1):
Args:
Args:
worker_hosts: comma-separated list of worker ip:port pairs.
worker_hosts: comma-separated list of worker ip:port pairs.
task_index: index of the worker.
Returns:
Returns:
Number of workers in the cluster.
Number of workers in the cluster.
...
...
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