The official repository for Deformable ProtoPNet, as described in "Deformable ProtoPNet: An Interpretable Image Classifier Using Deformable Prototypes".
MIT License
37
stars
11
forks
source link
UserWarning: Detected call of lr_scheduler.step() before optimizer.step() #6
Hi,
When the code runs to the fifth epoch, a warning appears: /home/hi/anaconda3/envs/CTracker/lib/python3.7/site-packages/torch/optim/lr_scheduler.py:134: 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. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate "https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning)
How should I change the code to eliminate this warning? Otherwise, the learning rate will be affected.
Thank you for pointing this out, and apologies for the delayed response. I've pushed a fix to the main branch -- please see commit e6a7d39 for the fix.
Hi, When the code runs to the fifth epoch, a warning appears: /home/hi/anaconda3/envs/CTracker/lib/python3.7/site-packages/torch/optim/lr_scheduler.py:134: 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 "https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning)How should I change the code to eliminate this warning? Otherwise, the learning rate will be affected.