nerfstudio-project / nerfacc

A General NeRF Acceleration Toolbox in PyTorch.
https://www.nerfacc.com/
Other
1.38k stars 113 forks source link

PropNetEstimator causes PyTorch "UserWarning: Detected call of `lr_scheduler.step()` before `optimizer.step()`" #289

Open MrMois opened 6 months ago

MrMois commented 6 months ago

Hello, thanks for this awesome library!

When using the PropNetEstimator, e.g. by running the example script, pytorch throws the warning

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

This is probably caused by this line. It doesn't interfere with training, but I think it would be good to prevent any warnings thrown by using nerfacc as intended.

Best, MrMois