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
98672351
Unverified
Commit
98672351
authored
Apr 24, 2019
by
Yuefeng Zhou
Committed by
GitHub
Apr 24, 2019
Browse files
Update distribution_utils.py (#6615)
parent
4ad73a1c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
official/utils/misc/distribution_utils.py
official/utils/misc/distribution_utils.py
+2
-3
No files found.
official/utils/misc/distribution_utils.py
View file @
98672351
...
@@ -230,9 +230,8 @@ def configure_cluster(worker_hosts=None, task_index=-1):
...
@@ -230,9 +230,8 @@ def configure_cluster(worker_hosts=None, task_index=-1):
"""
"""
tf_config
=
json
.
loads
(
os
.
environ
.
get
(
'TF_CONFIG'
,
'{}'
))
tf_config
=
json
.
loads
(
os
.
environ
.
get
(
'TF_CONFIG'
,
'{}'
))
if
tf_config
:
if
tf_config
:
num_workers
=
len
(
tf_config
[
'cluster'
][
'worker'
])
num_workers
=
(
len
(
tf_config
[
'cluster'
].
get
(
'chief'
,
[]))
+
if
tf_config
[
'cluster'
].
get
(
'chief'
,
None
):
len
(
tf_config
[
'cluster'
].
get
(
'worker'
,
[])))
num_workers
+=
1
elif
worker_hosts
:
elif
worker_hosts
:
workers
=
worker_hosts
.
split
(
','
)
workers
=
worker_hosts
.
split
(
','
)
num_workers
=
len
(
workers
)
num_workers
=
len
(
workers
)
...
...
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