Torch warning after warm-up epochs: `lr_scheduler.step()` before `optimizer.step()`
smdabdoub opened this issue · 0 comments
smdabdoub commented
After completing the warm-up epochs, Torch prints the following warning:
lib/python3.9/site-packages/torch/optim/lr_scheduler.py:131: UserWarning: Detected call of
lr_scheduler.step()
beforeoptimizer.step()
. In PyTorch 1.1.0 and later, you should call them in the opposite order:optimizer.step()
beforelr_scheduler.step()
. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
warnings.warn("Detected call oflr_scheduler.step()
beforeoptimizer.step()
. "