AttributeError: 'LambdaLR' object has no attribute 'get_last_lr'
See original GitHub issueI 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:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Upgrading to PyTorch 1.4 would solve that issue 😃
Current
master
branch recommends that:https://github.com/huggingface/transformers/blob/4e817ff41885063e08bb3bcd63e5adfd835b9911/setup.py#L70
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