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
5cf18a79
There was a problem fetching the pipeline summary.
Commit
5cf18a79
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Exit normally with the earlystop hook
parent
847b6f96
No related branches found
No related tags found
1 merge request
!43
add logging info to db_to_tfrecords
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MANIFEST.in
+1
-1
1 addition, 1 deletion
MANIFEST.in
bob/learn/tensorflow/script/train_and_evaluate.py
+16
-2
16 additions, 2 deletions
bob/learn/tensorflow/script/train_and_evaluate.py
with
17 additions
and
3 deletions
MANIFEST.in
+
1
−
1
View file @
5cf18a79
include README.rst
bootstrap-buildout.py
buildout.cfg
COPYING
version.txt requirements.txt
include README.rst buildout.cfg
LICENSE
version.txt requirements.txt
recursive-include doc *.py *.rst
recursive-include doc *.py *.rst
recursive-include bob *.wav *.hdf5 *.pickle *.meta *.ckp *.py *.png
recursive-include bob *.wav *.hdf5 *.pickle *.meta *.ckp *.py *.png
This diff is collapsed.
Click to expand it.
bob/learn/tensorflow/script/train_and_evaluate.py
+
16
−
2
View file @
5cf18a79
...
@@ -30,6 +30,11 @@ The configuration files should have the following objects totally:
...
@@ -30,6 +30,11 @@ The configuration files should have the following objects totally:
estimator
estimator
train_spec
train_spec
eval_spec
eval_spec
## Optional objects:
exit_ok_exceptions : [Exception]
A list of exceptions to exit properly if they occur. If nothing is
provided, the EarlyStopException is handled by default.
"""
"""
from
__future__
import
absolute_import
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
division
...
@@ -40,6 +45,7 @@ import tensorflow as tf
...
@@ -40,6 +45,7 @@ import tensorflow as tf
from
bob.extension.config
import
load
as
read_config_file
from
bob.extension.config
import
load
as
read_config_file
from
bob.learn.tensorflow.utils.commandline
import
\
from
bob.learn.tensorflow.utils.commandline
import
\
get_from_config_or_commandline
get_from_config_or_commandline
from
bob.learn.tensorflow.utils.hooks
import
EarlyStopException
from
bob.core.log
import
setup
,
set_verbosity_level
from
bob.core.log
import
setup
,
set_verbosity_level
logger
=
setup
(
__name__
)
logger
=
setup
(
__name__
)
...
@@ -62,13 +68,21 @@ def main(argv=None):
...
@@ -62,13 +68,21 @@ def main(argv=None):
# Sets-up logging
# Sets-up logging
set_verbosity_level
(
logger
,
verbosity
)
set_verbosity_level
(
logger
,
verbosity
)
# required
argumen
ts
# required
objec
ts
estimator
=
config
.
estimator
estimator
=
config
.
estimator
train_spec
=
config
.
train_spec
train_spec
=
config
.
train_spec
eval_spec
=
config
.
eval_spec
eval_spec
=
config
.
eval_spec
# optional objects
exit_ok_exceptions
=
getattr
(
config
,
'
exit_ok_exceptions
'
,
(
EarlyStopException
,))
# Train and evaluate
# Train and evaluate
tf
.
estimator
.
train_and_evaluate
(
estimator
,
train_spec
,
eval_spec
)
try
:
tf
.
estimator
.
train_and_evaluate
(
estimator
,
train_spec
,
eval_spec
)
except
exit_ok_exceptions
as
e
:
logger
.
exception
(
e
)
return
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
...
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