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
4a917d6e
You need to sign in or sign up before continuing.
Commit
4a917d6e
authored
Sep 11, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug in last commit.
parent
2cf9ad75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
tensorpack/callbacks/monitor.py
tensorpack/callbacks/monitor.py
+9
-1
tensorpack/callbacks/trigger.py
tensorpack/callbacks/trigger.py
+2
-2
No files found.
tensorpack/callbacks/monitor.py
View file @
4a917d6e
...
@@ -306,7 +306,7 @@ class JSONWriter(TrainingMonitor):
...
@@ -306,7 +306,7 @@ class JSONWriter(TrainingMonitor):
except
Exception
:
except
Exception
:
return
None
return
None
def
_
before_train
(
self
):
def
_
setup_graph
(
self
):
stats
=
JSONWriter
.
load_existing_json
()
stats
=
JSONWriter
.
load_existing_json
()
self
.
_fname
=
os
.
path
.
join
(
logger
.
get_logger_dir
(),
JSONWriter
.
FILENAME
)
self
.
_fname
=
os
.
path
.
join
(
logger
.
get_logger_dir
(),
JSONWriter
.
FILENAME
)
if
stats
is
not
None
:
if
stats
is
not
None
:
...
@@ -340,6 +340,10 @@ class JSONWriter(TrainingMonitor):
...
@@ -340,6 +340,10 @@ class JSONWriter(TrainingMonitor):
self
.
_last_gs
=
-
1
self
.
_last_gs
=
-
1
# in case we have something to log here.
def
_before_train
(
self
):
self
.
_trigger
()
def
_trigger_step
(
self
):
def
_trigger_step
(
self
):
# will do this in trigger_epoch
# will do this in trigger_epoch
if
self
.
local_step
!=
self
.
trainer
.
steps_per_epoch
-
1
:
if
self
.
local_step
!=
self
.
trainer
.
steps_per_epoch
-
1
:
...
@@ -407,6 +411,10 @@ class ScalarPrinter(TrainingMonitor):
...
@@ -407,6 +411,10 @@ class ScalarPrinter(TrainingMonitor):
self
.
_enable_epoch
=
enable_epoch
self
.
_enable_epoch
=
enable_epoch
self
.
_dic
=
{}
self
.
_dic
=
{}
# in case we have something to log here.
def
_before_train
(
self
):
self
.
_trigger
()
def
_trigger_step
(
self
):
def
_trigger_step
(
self
):
if
self
.
_enable_step
:
if
self
.
_enable_step
:
if
self
.
local_step
!=
self
.
trainer
.
steps_per_epoch
-
1
:
if
self
.
local_step
!=
self
.
trainer
.
steps_per_epoch
-
1
:
...
...
tensorpack/callbacks/trigger.py
View file @
4a917d6e
...
@@ -38,11 +38,11 @@ class PeriodicTrigger(ProxyCallback):
...
@@ -38,11 +38,11 @@ class PeriodicTrigger(ProxyCallback):
"Arguments to PeriodicTrigger have disabled the triggerable!"
"Arguments to PeriodicTrigger have disabled the triggerable!"
self
.
_step_k
=
every_k_steps
self
.
_step_k
=
every_k_steps
self
.
_epoch_k
=
every_k_epochs
self
.
_epoch_k
=
every_k_epochs
self
.
_before_train
=
before_train
self
.
_
do_
before_train
=
before_train
def
_before_train
(
self
):
def
_before_train
(
self
):
self
.
cb
.
before_train
()
self
.
cb
.
before_train
()
if
self
.
_before_train
:
if
self
.
_
do_
before_train
:
self
.
cb
.
trigger
()
self
.
cb
.
trigger
()
def
_trigger_step
(
self
):
def
_trigger_step
(
self
):
...
...
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