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
621f49ad
Commit
621f49ad
authored
Aug 04, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remote logging docs
parent
44076798
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
+37
-7
docs/tutorial/summary.md
docs/tutorial/summary.md
+18
-0
tensorpack/callbacks/monitor.py
tensorpack/callbacks/monitor.py
+19
-7
No files found.
docs/tutorial/summary.md
View file @
621f49ad
...
@@ -69,6 +69,24 @@ As a result, tensorboard will show not only summaries in the graph, but also you
...
@@ -69,6 +69,24 @@ As a result, tensorboard will show not only summaries in the graph, but also you
For example, a precise validation error often needs to be computed manually, outside the TensorFlow graph.
For example, a precise validation error often needs to be computed manually, outside the TensorFlow graph.
With a uniform monitor backend, this number will show up in tensorboard as well.
With a uniform monitor backend, this number will show up in tensorboard as well.
### Remote Logging
It is also easy to send data to online logging services
for experiment management and reproducibility.
For example, to send logging data to
[
comet.ml
](
https://www.comet.ml/
)
, you can use
[
CometMLMonitor
](
../modules/callbacks.html#tensorpack.callbacks.CometMLMonitor
)
.
To send logging data to
[
WandB
](
https://www.wandb.com/
)
,
it's even simpler -- you only need to do:
```
python
import
wandb
;
wandb
.
init
(
...
,
sync_tensorboard
=
True
)
```
Refer to their documentation for more types of logging you can do by using
their APIs directly:
[
comet.ml
](
https://www.comet.ml/docs/python-sdk/Experiment/
)
,
[
WandB
](
https://docs.wandb.com/docs/init.html
)
.
### Textual Logs
### Textual Logs
```
python
```
python
...
...
tensorpack/callbacks/monitor.py
View file @
621f49ad
...
@@ -550,33 +550,34 @@ class SendMonitorData(MonitorBase):
...
@@ -550,33 +550,34 @@ class SendMonitorData(MonitorBase):
class
CometMLMonitor
(
MonitorBase
):
class
CometMLMonitor
(
MonitorBase
):
"""
"""
Send
data
to https://www.comet.ml.
Send
scalar data and the graph
to https://www.comet.ml.
Note:
Note:
1. comet_ml requires you to `import comet_ml` before importing tensorflow or tensorpack.
1. comet_ml requires you to `import comet_ml` before importing tensorflow or tensorpack.
2. The "automatic output logging" feature of comet_ml will make the training progress bar appear to freeze.
2. The "automatic output logging" feature of comet_ml will make the training progress bar appear to freeze.
Therefore the feature is disabled by default.
Therefore the feature is disabled by default.
"""
"""
def
__init__
(
self
,
experiment
=
None
,
api_key
=
None
,
tags
=
None
,
**
kwargs
):
def
__init__
(
self
,
experiment
=
None
,
tags
=
None
,
**
kwargs
):
"""
"""
Args:
Args:
experiment (comet_ml.Experiment): if provided, invalidate all other arguments
experiment (comet_ml.Experiment): if provided, invalidate all other arguments
api_key (str): your comet.ml API key
tags (list[str]): experiment tags
tags (list[str]): experiment tags
kwargs: other arguments passed to :class:`comet_ml.Experiment`.
kwargs: arguments used to initialize :class:`comet_ml.Experiment`,
such as project name, API key, etc.
Refer to its documentation for details.
"""
"""
if
experiment
is
not
None
:
if
experiment
is
not
None
:
self
.
_exp
=
experiment
self
.
_exp
=
experiment
assert
api_key
is
None
and
tags
is
None
and
len
(
kwargs
)
==
0
assert
tags
is
None
and
len
(
kwargs
)
==
0
else
:
else
:
from
comet_ml
import
Experiment
from
comet_ml
import
Experiment
kwargs
.
setdefault
(
'log_code'
,
True
)
# though it's not functioning, git patch logging requires it
kwargs
.
setdefault
(
'log_code'
,
True
)
# though it's not functioning, git patch logging requires it
kwargs
.
setdefault
(
'auto_output_logging'
,
None
)
kwargs
.
setdefault
(
'auto_output_logging'
,
None
)
self
.
_exp
=
Experiment
(
api_key
=
api_key
,
**
kwargs
)
self
.
_exp
=
Experiment
(
**
kwargs
)
if
tags
is
not
None
:
if
tags
is
not
None
:
self
.
_exp
.
add_tags
(
tags
)
self
.
_exp
.
add_tags
(
tags
)
self
.
_exp
.
set_code
(
"Code logging is impossible
because there are too many files
..."
)
self
.
_exp
.
set_code
(
"Code logging is impossible ..."
)
self
.
_exp
.
log_dependency
(
'tensorpack'
,
__git_version__
)
self
.
_exp
.
log_dependency
(
'tensorpack'
,
__git_version__
)
@
property
@
property
...
@@ -593,6 +594,17 @@ class CometMLMonitor(MonitorBase):
...
@@ -593,6 +594,17 @@ class CometMLMonitor(MonitorBase):
def
process_scalar
(
self
,
name
,
val
):
def
process_scalar
(
self
,
name
,
val
):
self
.
_exp
.
log_metric
(
name
,
val
,
step
=
self
.
global_step
)
self
.
_exp
.
log_metric
(
name
,
val
,
step
=
self
.
global_step
)
@
HIDE_DOC
def
process_image
(
self
,
name
,
val
):
self
.
_exp
.
set_step
(
self
.
global_step
)
for
idx
,
v
in
enumerate
(
val
):
log_name
=
"{}_step{}{}"
.
format
(
name
,
self
.
global_step
,
"_"
+
str
(
idx
)
if
len
(
val
)
>
1
else
""
)
self
.
_exp
.
log_image
(
v
,
image_format
=
"jpeg"
,
name
=
log_name
,
image_minmax
=
(
0
,
255
))
def
_after_train
(
self
):
def
_after_train
(
self
):
self
.
_exp
.
end
()
self
.
_exp
.
end
()
...
...
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