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
da0984df
Commit
da0984df
authored
Aug 14, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use build_graph (fix #381)
parent
f644da74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
tensorpack/callbacks/trigger.py
tensorpack/callbacks/trigger.py
+6
-2
tensorpack/tfutils/export.py
tensorpack/tfutils/export.py
+1
-1
No files found.
tensorpack/callbacks/trigger.py
View file @
da0984df
...
...
@@ -21,7 +21,7 @@ class PeriodicTrigger(ProxyCallback):
every_k_epochs (int): trigger when ``epoch_num
%
k == 0``. Set to
None to disable.
every_k_steps and every_k_epochs can be both set, but cannot be both N
O
ne.
every_k_steps and every_k_epochs can be both set, but cannot be both N
o
ne.
"""
assert
isinstance
(
triggerable
,
Callback
),
type
(
triggerable
)
super
(
PeriodicTrigger
,
self
)
.
__init__
(
triggerable
)
...
...
@@ -55,7 +55,8 @@ class PeriodicRunHooks(ProxyCallback):
"""
Args:
callback (Callback):
every_k_steps(int):
every_k_steps(int): call ``{before,after}_run`` when
``global_step
%
k == 0``.
"""
self
.
_every_k_steps
=
int
(
every_k_steps
)
super
(
PeriodicRunHooks
,
self
)
.
__init__
(
callback
)
...
...
@@ -67,3 +68,6 @@ class PeriodicRunHooks(ProxyCallback):
def
_after_run
(
self
,
ctx
,
rv
):
if
self
.
global_step
%
self
.
_every_k_steps
==
0
:
self
.
cb
.
_after_run
(
ctx
,
rv
)
def
__str__
(
self
):
return
"PeriodicRunHooks-"
+
str
(
self
.
cb
)
tensorpack/tfutils/export.py
View file @
da0984df
...
...
@@ -89,7 +89,7 @@ class ModelExport(object):
"""
logger
.
info
(
'[export] build model for
%
s'
%
checkpoint
)
with
TowerContext
(
''
,
is_training
=
False
):
self
.
model
.
_
build_graph
(
self
.
input
)
self
.
model
.
build_graph
(
self
.
input
)
self
.
sess
=
tf
.
Session
(
config
=
tf
.
ConfigProto
(
allow_soft_placement
=
True
))
# load values from latest checkpoint
...
...
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