Skip to content
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

AttributeError: 'LambdaLR' object has no attribute 'get_last_lr' #3959

Closed
wasiahmad opened this issue Apr 25, 2020 · 6 comments · Fixed by #4446
Closed

AttributeError: 'LambdaLR' object has no attribute 'get_last_lr' #3959

wasiahmad opened this issue Apr 25, 2020 · 6 comments · Fixed by #4446

Comments

@wasiahmad
Copy link

I am trying to run the summarization example using BART and getting the following error.

tqdm_dict = {"loss": "{:.3f}".format(avg_loss), "lr": self.lr_scheduler.get_last_lr()[-1]}
AttributeError: 'LambdaLR' object has no attribute 'get_last_lr'

The error occurred at this line. I am using PyTorch 1.3.

@944721805
Copy link

I encountered the same problem, have you solved it?

@stefan-it
Copy link
Collaborator

stefan-it commented Apr 26, 2020

Upgrading to PyTorch 1.4 would solve that issue :)

Current master branch recommends that:

extras["torch"] = ["torch==1.4.0"]

@944721805
Copy link

Thank you so much, I have solved it.

@youkaichao
Copy link

get_last_lr is introduced in pytorch 1.4.0 . Maybe you need to upgrade your pytorch.

@julien-c
Copy link
Member

If you really are stuck with PyTorch <= 1.3 please feel free to open a PR to fix this with backward compatibility

@bing0037
Copy link

bing0037 commented May 4, 2020

I upgraded pytorch to v1.5.0, but run_glue.py with Bert model failed. So, you may have to set it to 1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants