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
400a07e6
Commit
400a07e6
authored
Apr 14, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "TFLocalCLIDebugHook" callback (#1142)
parent
91ea782a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
tensorpack/callbacks/hooks.py
tensorpack/callbacks/hooks.py
+25
-1
No files found.
tensorpack/callbacks/hooks.py
View file @
400a07e6
...
@@ -11,7 +11,7 @@ from ..utils.develop import HIDE_DOC
...
@@ -11,7 +11,7 @@ from ..utils.develop import HIDE_DOC
from
.base
import
Callback
from
.base
import
Callback
__all__
=
[
'CallbackToHook'
,
'HookToCallback'
]
__all__
=
[
'CallbackToHook'
,
'HookToCallback'
,
'TFLocalCLIDebugHook'
]
class
CallbackToHook
(
tfv1
.
train
.
SessionRunHook
):
class
CallbackToHook
(
tfv1
.
train
.
SessionRunHook
):
...
@@ -68,3 +68,27 @@ class HookToCallback(Callback):
...
@@ -68,3 +68,27 @@ class HookToCallback(Callback):
def
_after_train
(
self
):
def
_after_train
(
self
):
self
.
_hook
.
end
(
self
.
trainer
.
sess
)
self
.
_hook
.
end
(
self
.
trainer
.
sess
)
class
TFLocalCLIDebugHook
(
HookToCallback
):
"""
Use the hook `tfdbg.LocalCLIDebugHook` in tensorpack.
"""
_chief_only
=
True
def
__init__
(
self
,
*
args
,
**
kwargs
):
"""
Args:
args, kwargs: arguments to create `tfdbg.LocalCLIDebugHook`.
Refer to tensorflow documentation for details.
"""
from
tensorflow.python
import
debug
as
tfdbg
super
(
TFLocalCLIDebugHook
,
self
)
.
__init__
(
tfdbg
.
LocalCLIDebugHook
())
def
add_tensor_filter
(
self
,
*
args
,
**
kwargs
):
"""
Wrapper of `tfdbg.LocalCLIDebugHook.add_tensor_filter`.
Refer to tensorflow documentation for details.
"""
self
.
_hook
.
add_tensor_filter
(
*
args
,
**
kwargs
)
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