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.

Describe the bug resume training error AttributeError: ‘Momentum’ object has no attribute ‘set_dict’

To Reproduce Steps to reproduce the behavior: 1.Go to ‘PaddleViT/object_detection/Swin/’ 2.Run ‘python main_single_gpu.py -resume=’./output/train-20211210-09-50-43/Swin-Epoch-45’

The recovery of model can pass

Screenshots Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.2.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1483, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.2.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "F:/***/pp_swin/main_single_gpu.py", line 400, in <module> main() File "F:/***/pp_swin/main_single_gpu.py", line 313, in main optimizer.set_dict(opt_state) AttributeError: 'Momentum' object has no attribute 'set_dict'

Version (please complete the following information):

  • Paddle Version: [ 2.2.0]
  • Python Version [3.6]
  • GPU/CPU mode [ Gpu]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ky0107commented, Dec 15, 2021

Describe the bug resume training error AttributeError: ‘Momentum’ object has no attribute ‘set_dict’ To Reproduce Steps to reproduce the behavior: 1.Go to ‘PaddleViT/object_detection/Swin/’ 2.Run ‘python main_single_gpu.py -resume=’./output/train-20211210-09-50-43/Swin-Epoch-45’ The recovery of model can pass Screenshots Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.2.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1483, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "C:\Program Files\JetBrains\PyCharm Community Edition 2021.2.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "F:/***/pp_swin/main_single_gpu.py", line 400, in <module> main() File "F:/***/pp_swin/main_single_gpu.py", line 313, in main optimizer.set_dict(opt_state) AttributeError: 'Momentum' object has no attribute 'set_dict' Version (please complete the following information):

  • Paddle Version: [ 2.2.0]
  • Python Version [3.6]
  • GPU/CPU mode [ Gpu]

Hello! “main_single_gpu.py line 313” try to change optimizer.set_dict(opt_state) to optimizer.set_state_dict(opt_state)

Thank you for your answer and successfully solved the problem.

0reactions
xperzycommented, Dec 16, 2021

I have change the related code. Since this issue has been fixed, I close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

small and minor problems - synonyms and related words
Synonyms ; hitch · a problem that is not very serious ; triviality · a minor detail or difficulty ; bother · trouble...
Read more >
Small issue Definition | Law Insider
Small issue means the bond use category which includes all industrial development bonds that constitute qualified small issue bonds, as described in the ......
Read more >
218 Words and Phrases for Small Issue - Power Thesaurus
Synonyms for Small issue · minor problem · little issue · little problem · minor issue · small problem · small matter ·...
Read more >
The Small Issue (@thesmallissue) • Instagram photos and ...
The Small Issue. Fashion ➕ design ➕lifestyle blogzine for cool moms & kids since 2014 by Céline, parisian journalist, Achille and Rose ....
Read more >
Module G IRC § 144(a) – Qualified Small Issue Bonds Overview
Determine if a qualified small issue bond meets the $1M limitation. ... Under IRC § 144(a)(12), small issue bonds issued after December 31,...
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