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
b7e9ad13
Commit
b7e9ad13
authored
Aug 11, 2020
by
Ruoxin Sang
Committed by
A. Unique TensorFlower
Aug 11, 2020
Browse files
Remove the logic of saving checkpoint at step 0 in Orbit.
PiperOrigin-RevId: 326116282
parent
1bdf9bf4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
orbit/controller.py
orbit/controller.py
+3
-7
orbit/controller_test.py
orbit/controller_test.py
+2
-2
No files found.
orbit/controller.py
View file @
b7e9ad13
...
@@ -134,13 +134,9 @@ class Controller:
...
@@ -134,13 +134,9 @@ class Controller:
# TODO(momernick): We probably only want to do this on certain occasions?
# TODO(momernick): We probably only want to do this on certain occasions?
if
self
.
checkpoint_manager
is
not
None
:
if
self
.
checkpoint_manager
is
not
None
:
checkpoint_interval
=
self
.
checkpoint_manager
.
checkpoint_interval
checkpoint_interval
=
self
.
checkpoint_manager
.
checkpoint_interval
model_restored
=
self
.
restore_checkpoint
()
restored_path
=
self
.
restore_checkpoint
()
if
not
model_restored
and
(
checkpoint_interval
and
if
restored_path
:
self
.
trainer
is
not
None
):
logging
.
info
(
"Restored from checkpoint: %s"
,
restored_path
)
# If the model is not restored from a checkpoint, and
# `checkpoint_interval` is enabled for training, save an initial
# checkpoint.
self
.
save_checkpoint
()
def
train
(
self
,
steps
:
int
,
checkpoint_at_completion
:
bool
=
True
):
def
train
(
self
,
steps
:
int
,
checkpoint_at_completion
:
bool
=
True
):
"""Runs training.
"""Runs training.
...
...
orbit/controller_test.py
View file @
b7e9ad13
...
@@ -667,9 +667,9 @@ class ControllerTest(tf.test.TestCase, parameterized.TestCase):
...
@@ -667,9 +667,9 @@ class ControllerTest(tf.test.TestCase, parameterized.TestCase):
test_controller
.
train_and_evaluate
(
test_controller
.
train_and_evaluate
(
train_steps
=
10
,
eval_steps
=
2
,
eval_interval
=
5
)
train_steps
=
10
,
eval_steps
=
2
,
eval_interval
=
5
)
# Expect 3 checkpoints to be saved at step:
0,
5, 10.
# Expect 3 checkpoints to be saved at step: 5, 10.
self
.
assertLen
(
self
.
assertLen
(
tf
.
io
.
gfile
.
glob
(
os
.
path
.
join
(
self
.
model_dir
,
"ckpt-*.data*"
)),
3
)
tf
.
io
.
gfile
.
glob
(
os
.
path
.
join
(
self
.
model_dir
,
"ckpt-*.data*"
)),
2
)
# Expect evaluation is performed 2 times at step: 5, 10.
# Expect evaluation is performed 2 times at step: 5, 10.
self
.
assertLen
(
self
.
assertLen
(
summaries_with_matching_keyword
(
"eval_loss"
,
self
.
model_dir
),
2
)
summaries_with_matching_keyword
(
"eval_loss"
,
self
.
model_dir
),
2
)
...
...
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