其他分享
首页 > 其他分享> > UserWarning: Detected call of `lr scheduler.step()` before `optimizer.step()`.

UserWarning: Detected call of `lr scheduler.step()` before `optimizer.step()`.

作者:互联网

一、完成的错误信息

UserWarning: Detected call of lr scheduler.step() before optimizer.step(). In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step() before lr scheduler.step(). Failure to do this will result in PyTorch skipping the first value of the learning rate schedule.

在' optimizer.step() '之前检测到' lr scheduler.step() '的调用。在PyTorch 1.1.0及以后版本中,你应该以相反的顺序调用它们:' optimizer.step() '在' lr scheduler.step() '之前。如果做不到这一点,将导致PyTorch跳过学习速率计划的第一个值。

二、处理方式

image

标签:optimizer,UserWarning,PyTorch,step,lr,scheduler,before
来源: https://www.cnblogs.com/yuyingblogs/p/16336966.html