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
d10d0027
Commit
d10d0027
authored
Apr 09, 2020
by
Pengchong Jin
Committed by
A. Unique TensorFlower
Apr 09, 2020
Browse files
Save the checkpoint at step 0 and run evaluation.
PiperOrigin-RevId: 305806096
parent
5b095712
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
official/modeling/training/distributed_executor.py
official/modeling/training/distributed_executor.py
+13
-0
No files found.
official/modeling/training/distributed_executor.py
View file @
d10d0027
...
@@ -421,6 +421,19 @@ class DistributedExecutor(object):
...
@@ -421,6 +421,19 @@ class DistributedExecutor(object):
self
.
global_train_step
=
model
.
optimizer
.
iterations
self
.
global_train_step
=
model
.
optimizer
.
iterations
test_step
=
self
.
_create_test_step
(
strategy
,
model
,
metric
=
eval_metric
)
test_step
=
self
.
_create_test_step
(
strategy
,
model
,
metric
=
eval_metric
)
# Step-0 operations
_save_checkpoint
(
checkpoint
,
model_dir
,
checkpoint_name
.
format
(
step
=
current_step
))
if
test_step
:
eval_iterator
=
self
.
_get_input_iterator
(
eval_input_fn
,
strategy
)
eval_metric_result
=
self
.
_run_evaluation
(
test_step
,
current_step
,
eval_metric
,
eval_iterator
)
logging
.
info
(
'Step: %s evalation metric = %s.'
,
current_step
,
eval_metric_result
)
test_summary_writer
(
metrics
=
eval_metric_result
,
step
=
optimizer
.
iterations
)
eval_metric
.
reset_states
()
logging
.
info
(
'Training started'
)
logging
.
info
(
'Training started'
)
last_save_checkpoint_step
=
current_step
last_save_checkpoint_step
=
current_step
while
current_step
<
total_steps
:
while
current_step
<
total_steps
:
...
...
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