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
you can check if the StepLR or COS has get_last_lr function by "hasattr()", if not, replace “.get_last_lr()” to “[group['lr'] for group in self.optimizer.param_groups]”。refer:here line 97 and line 153
banben
pushed a commit
to banben/pytorch-gradual-warmup-lr-mod
that referenced
this issue
Aug 24, 2020
optimizer = optim.SGD(model.parameters(), lr=lr, momentum=0.9, nesterov=True, weight_decay=0.0001) scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(optimizer, max_epoch, eta_min=0, last_epoch=-1) scheduler_warmup = GradualWarmupScheduler(optimizer, multiplier=8, total_epoch=5, after_scheduler=scheduler)
AttributeError: 'CosineAnnealingLR' object has no attribute 'get_last_lr'
The text was updated successfully, but these errors were encountered: