RuntimeError('context has already been set')
See original GitHub issueafter installing 0.5.1 on Ubuntu I got following error:
Traceback (most recent call last):
File "/home/daniel/.local/bin/mnelab", line 8, in <module>
sys.exit(main())
File "/home/daniel/.local/lib/python3.6/site-packages/mnelab/__main__.py", line 27, in main
mp.set_start_method("spawn") # required for Linux/macOS
File "/usr/lib/python3.6/multiprocessing/context.py", line 242, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
RuntimeError: context has already been set(multiprocessing)
I use a spawn start methods to share CUDA tensors between processes import torch torch.multiprocessing.set_start_method("spawn") import ...
Read more >mp.set_start_method('spawn') triggered an error saying the ...
With mp.set_start_method('spawn') , I got the error RuntimeError: context has already been set and if I use mp.set_start_method('spawn', ...
Read more >Multiprocessing for cuda error - PyTorch Forums
I want to use torch.multiprocessing to accelerate my loop, however there are some errors . I can't absolutely understand the shared cuda ...
Read more >OS 3.3.12 crashes when spawning experiment process ...
OS 3.3. 12 crashes when spawning experiment process, "context has already been set" — Forum.
Read more >Multiprocessing Start Methods - Super Fast Python
Running the example results in a RuntimeError indicating that the start method has already been set. 1. 2. 3. 4. Start Method: spawn....
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 Free
Top 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
Running this twice on my computer (Python 3.6.8, Ipython 7.8.0)
throw the same error, so it seems that at least on my computer when the Mnelab is starting the spawn is invoked more than once (but I don’t know how)
Using
force=TRUE
solve the problem (see the issue I linked before)@danieltomasz could you please try the following:
mp.set_start_method("spawn")
in__main__.py
mp.set_start_method("spawn")
inmainwindow.py
as the first line of the__init__
function of theMainWindow
class (should be line 90).Please let me know if that works for you. Make sure to test if multiprocessing works by loading a file and computing ICA (this is currently the only thing which requires multiprocessing).