-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: The provided lr scheduler "<torch.optim.lr_scheduler.LambdaLR object at 0x7fda400bdee0>" is invalid #10
Comments
Hi, I think it might be because that pytorch 2.0.1 is used here. The base class of schedulers is _LRScheduler in versions below 2.0.0 (see here), which is used for if-else in pytorch-lightning 1.5.7 (see here). However, the name is changed to LRScheduler in versions above 2.0.0 (see here). Therefore, I think downgrade pytorch to versions below 2.0.0 might solve the problem. |
In that case, please make sure your requirements.txt is updated. For instance, the wheel for torch==1.8.1+cu101 is no longer available. I had to install Pytorch 2.0 and that resulted in this issue. Over the past week I have just worked on setting up 10 different virtual environments with various combinations of torch,lightning, pyg, sparse, scatter etc. but i still cant get your code to work. Please kindly check the requirement.txt file |
I somehow managed to replicate your requirements.txt environment after reinstalling via various methods.
|
Hi @kxz18 , I am trying to run your repo locally. I have the same package versions of the libraries you are using and I am getting
File ".../lib/python3.9/site-packages/pytorch_lightning/trainer/optimizers.py", line 192, in _configure_schedulers raise ValueError(f'The provided lr scheduler "{scheduler}" is invalid') ValueError: The provided lr scheduler "<torch.optim.lr_scheduler.OneCycleLR object at 0x151eea83f520>" is invalid
when I run train.py. This seems to be an issue with Lightning but I have the exact same version of Lightning as your codebase so I am not sure why this error is occuring. Is there any workaround?This is the output after I run collect_env:
The text was updated successfully, but these errors were encountered: