Commit 087e66db authored by Yuxin Wu's avatar Yuxin Wu

fix bug in EnableCallbackIf when used with before_run

parent ac09ed56
...@@ -94,7 +94,7 @@ class EnableCallbackIf(ProxyCallback): ...@@ -94,7 +94,7 @@ class EnableCallbackIf(ProxyCallback):
def _before_run(self, ctx): def _before_run(self, ctx):
if self._pred(self): if self._pred(self):
super(EnableCallbackIf, self)._before_run(ctx) return super(EnableCallbackIf, self)._before_run(ctx)
def _after_run(self, ctx, rv): def _after_run(self, ctx, rv):
if self._pred(self): if self._pred(self):
......
...@@ -66,7 +66,7 @@ class Trainer(object): ...@@ -66,7 +66,7 @@ class Trainer(object):
config (TrainConfig): the config used in this trainer. config (TrainConfig): the config used in this trainer.
model (ModelDesc): alias for ``config.model``. model (ModelDesc): alias for ``config.model``.
sess (tf.Session): the current session in use. sess (tf.Session): the current session in use.
hooked_sess (tf.MonitoredSession): the session with hooks. hooked_sess (tf.train.MonitoredSession): the session with hooks.
monitors (Monitors): the monitors. Other callbacks can use it for logging. monitors (Monitors): the monitors. Other callbacks can use it for logging.
local_step (int): the number of (tensorpack) steps that have finished in the current epoch. local_step (int): the number of (tensorpack) steps that have finished in the current epoch.
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment