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
b912c32a
Commit
b912c32a
authored
Jun 12, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove deprecated StatPrinter
parent
16145cc8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
29 deletions
+4
-29
tensorpack/callbacks/group.py
tensorpack/callbacks/group.py
+0
-13
tensorpack/callbacks/stats.py
tensorpack/callbacks/stats.py
+1
-9
tensorpack/train/config.py
tensorpack/train/config.py
+3
-7
No files found.
tensorpack/callbacks/group.py
View file @
b912c32a
...
...
@@ -8,7 +8,6 @@ import time
import
traceback
from
.base
import
Callback
from
.stats
import
StatPrinter
from
.hooks
import
CallbackToHook
from
..utils
import
logger
...
...
@@ -57,18 +56,6 @@ class Callbacks(Callback):
# check type
for
cb
in
cbs
:
assert
isinstance
(
cb
,
Callback
),
cb
.
__class__
# move "StatPrinter" to the last
# TODO don't need to manually move in the future.
for
idx
,
cb
in
enumerate
(
cbs
):
if
isinstance
(
cb
,
StatPrinter
):
sp
=
cb
cbs
.
remove
(
sp
)
cbs
.
append
(
sp
)
if
idx
!=
len
(
cbs
)
-
1
:
logger
.
warn
(
"StatPrinter should appear as the last element of callbacks! "
"This is now fixed automatically, but may not work in the future."
)
break
self
.
cbs
=
cbs
def
_setup_graph
(
self
):
...
...
tensorpack/callbacks/stats.py
View file @
b912c32a
...
...
@@ -6,16 +6,8 @@ import os
from
.base
import
Callback
from
..utils
import
logger
from
..utils.develop
import
log_deprecated
__all__
=
[
'StatPrinter'
,
'SendStat'
]
class
StatPrinter
(
Callback
):
def
__init__
(
self
,
print_tag
=
None
):
log_deprecated
(
"StatPrinter"
,
"No need to add StatPrinter to callbacks anymore!"
,
"2017-05-26"
)
__all__
=
[
'SendStat'
]
class
SendStat
(
Callback
):
...
...
tensorpack/train/config.py
View file @
b912c32a
...
...
@@ -78,13 +78,9 @@ class TrainConfig(object):
if
callbacks
is
None
:
callbacks
=
[]
if
isinstance
(
callbacks
,
Callbacks
):
# keep quiet now because I haven't determined the final API yet.
log_deprecated
(
"TrainConfig(callbacks=Callbacks([...]))"
,
"Change the argument 'callbacks=' to a *list* of callbacks without StatPrinter()."
)
callbacks
=
callbacks
.
cbs
[:
-
1
]
# the last one is StatPrinter()
assert
not
isinstance
(
callbacks
,
Callbacks
),
\
"TrainConfig(callbacks=Callbacks([...]))"
\
"Change the argument 'callbacks=' to a *list* of callbacks without StatPrinter()."
assert_type
(
callbacks
,
list
)
if
extra_callbacks
is
None
:
extra_callbacks
=
[
...
...
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