question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
stefan-itcommented, Apr 26, 2020

Upgrading to PyTorch 1.4 would solve that issue 😃

Current master branch recommends that:

https://github.com/huggingface/transformers/blob/4e817ff41885063e08bb3bcd63e5adfd835b9911/setup.py#L70

0reactions
bing0037commented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

'LambdaLR' object has no attribute 'param_groups' in deberta ...
Based on the error message it seems you are passing a scheduler to scaler.step() instead of an optimizer.
Read more >
Error implementing torch.optim.lr_scheduler.LambdaLR in ...
I'm working on an Image classifier and trying to implement Cyclical Learning Rates to have a better results. I ...
Read more >
torch.optim.lr_scheduler — Catalyst 20.07 documentation
class _LRScheduler(object): def __init__(self, optimizer, last_epoch=-1): ... the returned function here is no longer a bound method, # so attributes like ...
Read more >
'LambdaLR' object has no attribute 'get_last_lr'が出た
概要 BERTで事前学習を行っているとき AttributeError: 'LambdaLR' object has no attribute 'get_last_lr' というエラーが出ていた。
Read more >
AttributeError: 'StepLR' object has no attribute 'get_last_lr'
报错信息:AttributeError: 'StepLR' object has no attribute 'get_last_lr'. 解决方法:跳进StepLR类中发现StepLR类中的方法是get_lr,改了名字。
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found