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
df7e66d2
Unverified
Commit
df7e66d2
authored
Jul 28, 2020
by
Srihari Humbarwadi
Committed by
GitHub
Jul 28, 2020
Browse files
fixed typos in doc strings and variable naming
parent
07484704
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
official/modeling/training/distributed_executor.py
official/modeling/training/distributed_executor.py
+7
-6
No files found.
official/modeling/training/distributed_executor.py
View file @
df7e66d2
...
...
@@ -63,8 +63,8 @@ def metrics_as_dict(metric):
"""Puts input metric(s) into a list.
Args:
metric: metric(s) to be put into the list. `metric` could be a object, a
list or a dict of tf.keras.metrics.Metric or has the `required_method`.
metric: metric(s) to be put into the list. `metric` could be a
n
object, a
list
,
or a dict of tf.keras.metrics.Metric or has the `required_method`.
Returns:
A dictionary of valid metrics.
...
...
@@ -351,7 +351,8 @@ class DistributedExecutor(object):
train_input_fn: (params: dict) -> tf.data.Dataset training data input
function.
eval_input_fn: (Optional) same type as train_input_fn. If not None, will
trigger evaluting metric on eval data. If None, will not run eval step.
trigger evaluating metric on eval data. If None, will not run the eval
step.
model_dir: the folder path for model checkpoints.
total_steps: total training steps.
iterations_per_loop: train steps per loop. After each loop, this job will
...
...
@@ -672,7 +673,7 @@ class DistributedExecutor(object):
raise
ValueError
(
'if `eval_metric_fn` is specified, '
'eval_metric_fn must be a callable.'
)
old_ph
r
ase
=
tf
.
keras
.
backend
.
learning_phase
()
old_phase
=
tf
.
keras
.
backend
.
learning_phase
()
tf
.
keras
.
backend
.
set_learning_phase
(
0
)
params
=
self
.
_params
strategy
=
self
.
_strategy
...
...
@@ -709,7 +710,7 @@ class DistributedExecutor(object):
summary_writer
(
metrics
=
eval_metric_result
,
step
=
current_step
)
reset_states
(
eval_metric
)
tf
.
keras
.
backend
.
set_learning_phase
(
old_ph
r
ase
)
tf
.
keras
.
backend
.
set_learning_phase
(
old_phase
)
return
eval_metric_result
,
current_step
def
predict
(
self
):
...
...
@@ -759,7 +760,7 @@ class ExecutorBuilder(object):
Args:
strategy_type: string. One of 'tpu', 'mirrored', 'multi_worker_mirrored'.
If None
. U
ser is responsible to set the strategy before calling
If None
, the u
ser is responsible to set the strategy before calling
build_executor(...).
strategy_config: necessary config for constructing the proper Strategy.
Check strategy_flags_dict() for examples of the structure.
...
...
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