You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In trainer.py, at line 71 self.lr_scheduler.step() should be replaced by self.lr_scheduler.step(epoch)
the source code of the function step is
def step(self, epoch=None):
if epoch is None:
epoch = self.last_epoch + 1
self.last_epoch = epoch
for param_group, lr in zip(self.optimizer.param_groups, self.get_lr()):
param_group['lr'] = lr
Because when resuming from a checkpoint, the lr_scheduler will init from scratch, the default value of parameterlast_epoch in lr_scheduler will be -1 rather than the last epoch in checkpoint.
The text was updated successfully, but these errors were encountered:
SunQpark
added a commit
to SunQpark/pytorch-template
that referenced
this issue
Jun 12, 2020
In trainer.py, at line 71
self.lr_scheduler.step()
should be replaced byself.lr_scheduler.step(epoch)
the source code of the function step is
Because when resuming from a checkpoint, the lr_scheduler will init from scratch, the default value of parameter
last_epoch
in lr_scheduler will be -1 rather than the last epoch in checkpoint.The text was updated successfully, but these errors were encountered: