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
bec166dd
Commit
bec166dd
authored
Jun 05, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use NewSessionCreate in PredictConfig, so that variables are initialized (fix #1225)
parent
7c8cbba0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
tensorpack/predict/config.py
tensorpack/predict/config.py
+3
-2
No files found.
tensorpack/predict/config.py
View file @
bec166dd
...
...
@@ -8,6 +8,7 @@ from ..compat import tfv1 as tf
from
..graph_builder
import
ModelDescBase
from
..tfutils
import
get_default_sess_config
from
..tfutils.sessinit
import
JustCurrentSession
,
SessionInit
from
..tfutils.sesscreate
import
NewSessionCreator
from
..tfutils.tower
import
TowerFuncWrapper
from
..utils
import
logger
...
...
@@ -61,7 +62,7 @@ class PredictConfig(object):
tensors can be any tensor in the graph that's computable from the tensors correponding to `input_names`.
session_creator (tf.train.SessionCreator): how to create the
session. Defaults to :class:`
tf.train.Chief
SessionCreator()`.
session. Defaults to :class:`
New
SessionCreator()`.
session_init (SessionInit): how to initialize variables of the session.
Defaults to do nothing.
...
...
@@ -98,7 +99,7 @@ class PredictConfig(object):
assert_type
(
self
.
session_init
,
SessionInit
,
'session_init'
)
if
session_creator
is
None
:
self
.
session_creator
=
tf
.
train
.
Chief
SessionCreator
(
config
=
get_default_sess_config
())
self
.
session_creator
=
New
SessionCreator
(
config
=
get_default_sess_config
())
else
:
self
.
session_creator
=
session_creator
...
...
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