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
76514ac7
Commit
76514ac7
authored
Jan 16, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid consuming data for summary, in SimpleTrainer
parent
4cb898a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
tensorpack/models/model_desc.py
tensorpack/models/model_desc.py
+2
-0
tensorpack/train/feedfree.py
tensorpack/train/feedfree.py
+2
-2
tensorpack/train/input_data.py
tensorpack/train/input_data.py
+4
-0
tensorpack/train/trainer.py
tensorpack/train/trainer.py
+2
-2
No files found.
tensorpack/models/model_desc.py
View file @
76514ac7
...
...
@@ -161,6 +161,8 @@ class ModelFromMetaGraph(ModelDesc):
Only useful for inference.
"""
# TODO can this be really used for inference?
def
__init__
(
self
,
filename
):
"""
Args:
...
...
tensorpack/train/feedfree.py
View file @
76514ac7
...
...
@@ -25,8 +25,8 @@ class FeedfreeTrainerBase(Trainer):
"""
def
_trigger_epoch
(
self
):
#
need to
run summary_op every epoch
#
note that summary_op will take a data from the queue
# run summary_op every epoch
#
TODO summary_op will take a data! This is not good for TensorInput.
if
self
.
summary_op
is
not
None
:
summary_str
=
self
.
summary_op
.
eval
()
self
.
add_summary
(
summary_str
)
...
...
tensorpack/train/input_data.py
View file @
76514ac7
...
...
@@ -45,8 +45,12 @@ class FeedInput(InputData):
def
next_feed
(
self
):
data
=
next
(
self
.
data_producer
)
feed
=
dict
(
zip
(
self
.
input_vars
,
data
))
self
.
_last_feed
=
feed
return
feed
def
last_feed
(
self
):
return
self
.
_last_feed
class
FeedfreeInput
(
InputData
):
""" Abstract base for input without feed,
...
...
tensorpack/train/trainer.py
View file @
76514ac7
...
...
@@ -66,7 +66,7 @@ class SimpleTrainer(Trainer):
self
.
_predictor_factory
=
PredictorFactory
(
self
.
sess
,
self
.
model
,
[
0
])
if
config
.
dataflow
is
None
:
self
.
_input_method
=
config
.
data
assert
isinstance
(
self
.
_input_method
,
FeedInput
)
assert
isinstance
(
self
.
_input_method
,
FeedInput
)
,
type
(
self
.
_input_method
)
else
:
self
.
_input_method
=
FeedInput
(
config
.
dataflow
)
...
...
@@ -93,7 +93,7 @@ class SimpleTrainer(Trainer):
def
_trigger_epoch
(
self
):
if
self
.
summary_op
is
not
None
:
feed
=
self
.
_input_method
.
nex
t_feed
()
feed
=
self
.
_input_method
.
las
t_feed
()
summary_str
=
self
.
summary_op
.
eval
(
feed_dict
=
feed
)
self
.
add_summary
(
summary_str
)
...
...
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