Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
d6258a71
Commit
d6258a71
authored
Jun 01, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-enable session_config in TrainConfig
parent
e2cc7058
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
CHANGES.md
CHANGES.md
+1
-2
tensorpack/train/config.py
tensorpack/train/config.py
+6
-9
No files found.
CHANGES.md
View file @
d6258a71
...
...
@@ -14,8 +14,7 @@ TensorFlow itself also changed APIs before 1.0 and those are not listed here.
+
[
2017/04/09
](
https://github.com/ppwwyyxx/tensorpack/commit/5beab907895aec36bdcaed62e25b976aad7979b8
)
.
`ParamRestore`
was renamed to
`DictRestore`
.
+
[
2017/03/16
](
https://github.com/ppwwyyxx/tensorpack/commit/ccae46f4a3ca89dc3df901a338eef8447d19a730
)
.
`session_config`
option in
`TrainConfig`
and
`PredictConfig`
is deprecated.
Use
`session_creator`
to define how to create session instead.
`session_config`
option in
`PredictConfig`
is deprecated. Use
`session_creator`
to define how to create session instead.
+
2017/02/20. The interface of step callbacks are changed to be the same as
`tf.train.SessionRunHook`
.
If you haven't written any custom step callbacks, there is nothing to do. Otherwise please refer
to the
[
existing callbacks
](
https://github.com/ppwwyyxx/tensorpack/blob/master/tensorpack/callbacks/steps.py
)
.
...
...
tensorpack/train/config.py
View file @
d6258a71
...
...
@@ -45,12 +45,10 @@ class TrainConfig(object):
callbacks that will be used in the end are ``callbacks + extra_callbacks``.
monitors (list): a list of :class:`TrainingMonitor`.
Defaults to ``[TFSummaryWriter(), JSONWriter(), ScalarPrinter()]``.
session_creator (tf.train.SessionCreator): how to create the
session. Defaults to :class:`sesscreate.NewSessionCreator()`
with the config returned by
:func:`tfutils.get_default_sess_config()`.
session_init (SessionInit): how to initialize variables of a
session. Defaults to do nothing.
session_creator (tf.train.SessionCreator): Defaults to :class:`sesscreate.NewSessionCreator()`
with the config returned by :func:`tfutils.get_default_sess_config()`.
session_config (tf.ConfigProto): when session_creator is None, use this to create the session.
session_init (SessionInit): how to initialize variables of a session. Defaults to do nothing.
starting_epoch (int): The index of the first epoch.
steps_per_epoch (int): the number of steps (defined by :meth:`Trainer.run_step`) to run in each epoch.
Defaults to the input data size.
...
...
@@ -111,14 +109,13 @@ class TrainConfig(object):
if
session_creator
is
None
:
if
session_config
is
not
None
:
log_deprecated
(
"TrainConfig(session_config=)"
,
"Use session_creator=NewSessionCreator(config=) instead!"
,
"2017-05-20"
)
self
.
session_creator
=
NewSessionCreator
(
config
=
session_config
)
else
:
self
.
session_creator
=
NewSessionCreator
(
config
=
get_default_sess_config
())
else
:
self
.
session_creator
=
session_creator
assert
session_config
is
None
,
"Cannot set both session_creator and session_config!"
self
.
session_config
=
session_config
if
steps_per_epoch
is
None
:
steps_per_epoch
=
kwargs
.
pop
(
'step_per_epoch'
,
None
)
...
...
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