Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.tensorflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.tensorflow
Commits
12964af5
There was a problem fetching the pipeline summary.
Commit
12964af5
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Handle folder checkpoints
parent
55d973ee
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!52
Implement model saving in bob tf eval. Fixes #54
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/tensorflow/script/predict_bio.py
+9
-1
9 additions, 1 deletion
bob/learn/tensorflow/script/predict_bio.py
with
9 additions
and
1 deletion
bob/learn/tensorflow/script/predict_bio.py
+
9
−
1
View file @
12964af5
...
...
@@ -13,6 +13,7 @@ from bob.extension.scripts.click_helper import (
from
multiprocessing
import
Pool
from
collections
import
defaultdict
import
numpy
as
np
import
tensorflow
as
tf
from
bob.io.base
import
create_directories_safe
from
bob.bio.base.utils
import
save
from
bob.bio.base.tools.grid
import
indices
...
...
@@ -121,7 +122,9 @@ def predict_bio(estimator, database, biofiles, bio_predict_input_fn,
`None`, returns all.
checkpoint_path : str, optional
Path of a specific checkpoint to predict. If `None`, the latest
checkpoint in `model_dir` is used.
checkpoint in `model_dir` is used. This can also be a folder which
contains a
"
checkpoint
"
file where the latest checkpoint from inside
this file will be used as checkpoint_path.
multiple_samples : bool, optional
If provided, it assumes that the db interface returns several samples
from a biofile. This option can be used when you are working with
...
...
@@ -216,6 +219,11 @@ def predict_bio(estimator, database, biofiles, bio_predict_input_fn,
generator
.
output_shapes
)
if
checkpoint_path
:
if
os
.
path
.
isdir
(
checkpoint_path
):
ckpt
=
tf
.
train
.
get_checkpoint_state
(
estimator
.
model_dir
)
if
ckpt
and
ckpt
.
model_checkpoint_path
:
checkpoint_path
=
ckpt
.
model_checkpoint_path
logger
.
info
(
"
Restoring the model from %s
"
,
checkpoint_path
)
predictions
=
estimator
.
predict
(
...
...
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