在使用pytorch的指数衰减学习率时,报错:
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.
按照报错说明进行修改:
把scheduler.step()放在每次epoch训练完成之后