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
9fc641e4
Commit
9fc641e4
authored
Jun 27, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "create_scalar_summary -> tb.summary.scalar_pb"
This reverts commit
77cee2b2
.
parent
9b1d1095
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
tensorpack/callbacks/monitor.py
tensorpack/callbacks/monitor.py
+2
-3
tensorpack/tfutils/summary.py
tensorpack/tfutils/summary.py
+15
-0
No files found.
tensorpack/callbacks/monitor.py
View file @
9fc641e4
...
@@ -14,9 +14,8 @@ import json
...
@@ -14,9 +14,8 @@ import json
import
re
import
re
import
tensorflow
as
tf
import
tensorflow
as
tf
import
tensorboard
as
tb
from
..utils
import
logger
from
..utils
import
logger
from
..tfutils.summary
import
create_image_summary
from
..tfutils.summary
import
create_
scalar_summary
,
create_
image_summary
from
.base
import
Callback
from
.base
import
Callback
__all__
=
[
'TrainingMonitor'
,
'Monitors'
,
__all__
=
[
'TrainingMonitor'
,
'Monitors'
,
...
@@ -162,7 +161,7 @@ class Monitors(Callback):
...
@@ -162,7 +161,7 @@ class Monitors(Callback):
if
isinstance
(
val
,
np
.
integer
):
if
isinstance
(
val
,
np
.
integer
):
val
=
int
(
val
)
val
=
int
(
val
)
self
.
_dispatch
(
lambda
m
:
m
.
process_scalar
(
name
,
val
))
self
.
_dispatch
(
lambda
m
:
m
.
process_scalar
(
name
,
val
))
s
=
tb
.
summary
.
scalar_pb
(
name
,
val
)
s
=
create_scalar_summary
(
name
,
val
)
self
.
_dispatch
(
lambda
m
:
m
.
process_summary
(
s
))
self
.
_dispatch
(
lambda
m
:
m
.
process_summary
(
s
))
def
put_image
(
self
,
name
,
val
):
def
put_image
(
self
,
name
,
val
):
...
...
tensorpack/tfutils/summary.py
View file @
9fc641e4
...
@@ -39,6 +39,21 @@ def _enter_vs_reuse_ns(name):
...
@@ -39,6 +39,21 @@ def _enter_vs_reuse_ns(name):
yield
vs
yield
vs
def
create_scalar_summary
(
name
,
v
):
"""
Args:
name (str):
v (float): scalar value
Returns:
tf.Summary: a tf.Summary object with name and simple scalar value v.
"""
assert
isinstance
(
name
,
six
.
string_types
),
type
(
name
)
v
=
float
(
v
)
s
=
tf
.
Summary
()
s
.
value
.
add
(
tag
=
name
,
simple_value
=
v
)
return
s
def
create_image_summary
(
name
,
val
):
def
create_image_summary
(
name
,
val
):
"""
"""
Args:
Args:
...
...
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