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.

ImportError: cannot import name 'save_config'

See original GitHub issue

❓ Questions and Help

Hello

I would like to a multigpu training. I check if my version of pytorch supported the multigpu training thanks to the command: torch.distributed.is_available() Its the case. But when I try: python -m torch.distributed.launch --nproc_per_node=2 tools/train_net.py --config-file "configs/dcn/e2e_mask_rcnn_dconv_R_50_FPN_1x.yaml" I receive the following error:

Traceback (most recent call last):
  File "tools/train_net.py", line 26, in <module>
    from maskrcnn_benchmark.utils.miscellaneous import mkdir, save_config
ImportError: cannot import name 'save_config'

The thing is I arrive to call save_config from the interpreter. Any idea how I could make it works for multi-gpu.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jaemin93commented, Jun 18, 2020

I know why this problem occurred. install seems to be working, but it is not. Make sure to place the maskrcnn packages properly in your Python environment.

  1. Install $ python setup.py build develop

  2. Find maskrcnn packages location $ find / -name 'miscellaneous.py'

/root/maskrcnn-benchmark/build/lib.linux-x86_64-3.6/maskrcnn_benchmark/utils/miscellaneous.py
/root/maskrcnn-benchmark/maskrcnn_benchmark/utils/miscellaneous.py
/opt/conda/lib/python3.6/site-packages/maskrcnn_benchmark/utils/miscellaneous.py
/opt/pytorch/examples/maskrcnn/pytorch/maskrcnn_benchmark/utils/miscellaneous.py
/workspace/examples/maskrcnn/pytorch/maskrcnn_benchmark/utils/miscellaneous.py
  1. Remove and Copy
$ rm -rf /opt/conda/lib/python3.6/site-packages/maskrcnn_benchmark
$ cp -r maskrcnn-benchmark/build/lib.linux-x86_64-3.6/maskrcnn_benchmark /opt/conda/lib/python3.6/site-packages/

It worked in my case.

0reactions
wanghao14commented, Jul 17, 2020

@jaemin93 Thanks a lot! Your solution works for me, too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Only save config if changed - python - Stack Overflow
I am asking because in some scripts i save the config everytime i close some application and when i'm commiting my folder i...
Read more >
Can't load/save config "An error occurred, please try again ...
i had try ,but ,import config failed too! site name= region= storage_class standard= rrs=EC:2 # cache drives= exclude= expiry=90 quota=80 after= ...
Read more >
Palo Alto Save Config and Import Into Another Firewall Device
This is a quick example on how to export a config from a working Firewall and import it into a brand new device...
Read more >
marketing cloud - Salesforce Import Activity
And when i am trying to import record into Data Extension record count still can't increase. Using 18 digit id; Added Contact ID...
Read more >
EasySettings - PyPI
EasySettings. EasySettings allows you to easily save and retrieve simple application settings. Handles non-string types like boolean, integer, long, list, ...
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