Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AMBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
AMBS
Commits
aee36dd3
Commit
aee36dd3
authored
Aug 13, 2021
by
Michael Langguth
Browse files
Options
Downloads
Patches
Plain Diff
Add print-statement to identify checkpoint that is restored.
parent
7a54fa1a
No related branches found
No related tags found
No related merge requests found
Pipeline
#75864
passed
Aug 17, 2021
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
video_prediction_tools/model_modules/video_prediction/utils/tf_utils.py
+4
-0
4 additions, 0 deletions
...on_tools/model_modules/video_prediction/utils/tf_utils.py
with
4 additions
and
0 deletions
video_prediction_tools/model_modules/video_prediction/utils/tf_utils.py
+
4
−
0
View file @
aee36dd3
...
@@ -526,10 +526,14 @@ def reduce_tensors(structures, shallow=False):
...
@@ -526,10 +526,14 @@ def reduce_tensors(structures, shallow=False):
def
get_checkpoint_restore_saver
(
checkpoint
,
var_list
=
None
,
skip_global_step
=
False
,
restore_to_checkpoint_mapping
=
None
):
def
get_checkpoint_restore_saver
(
checkpoint
,
var_list
=
None
,
skip_global_step
=
False
,
restore_to_checkpoint_mapping
=
None
):
method
=
get_checkpoint_restore_saver
.
__name__
if
os
.
path
.
isdir
(
checkpoint
):
if
os
.
path
.
isdir
(
checkpoint
):
# latest_checkpoint doesn't work when the path has special characters
# latest_checkpoint doesn't work when the path has special characters
checkpoint
=
tf
.
train
.
latest_checkpoint
(
checkpoint
)
checkpoint
=
tf
.
train
.
latest_checkpoint
(
checkpoint
)
# print name of checkpoint-file for verbosity
print
(
"
%{0}: The follwoing checkpoint is used for restoring the model:
'
{1}
'"
.
format
(
method
,
checkpoint
))
# Start processing the checkpoint
checkpoint_reader
=
tf
.
pywrap_tensorflow
.
NewCheckpointReader
(
checkpoint
)
checkpoint_reader
=
tf
.
pywrap_tensorflow
.
NewCheckpointReader
(
checkpoint
)
checkpoint_var_names
=
checkpoint_reader
.
get_variable_to_shape_map
().
keys
()
checkpoint_var_names
=
checkpoint_reader
.
get_variable_to_shape_map
().
keys
()
restore_to_checkpoint_mapping
=
restore_to_checkpoint_mapping
or
(
lambda
name
,
_
:
name
.
split
(
'
:
'
)[
0
])
restore_to_checkpoint_mapping
=
restore_to_checkpoint_mapping
or
(
lambda
name
,
_
:
name
.
split
(
'
:
'
)[
0
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment