Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Windows 10, ValueError: cannot find context for 'fork' #129

Closed
witignite opened this issue Aug 30, 2020 · 3 comments
Closed

On Windows 10, ValueError: cannot find context for 'fork' #129

witignite opened this issue Aug 30, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@witignite
Copy link
Contributor

When I tried to run visualise_data.ipynb on Windows, I received the following error:

D:\l5kit\l5kit\l5kit\dataset\select_agents.py in <module>
     20 from l5kit.geometry import angular_distance
     21 
---> 22 multiprocessing.set_start_method("fork", force=True)  # this fix loop in python 3.8 on MacOS
     23 os.environ["BLOSC_NOLOCK"] = "1"  # this is required for multiprocessing
     24 

~\Anaconda3\envs\py37\lib\multiprocessing\context.py in set_start_method(self, method, force)
    244             self._actual_context = None
    245             return
--> 246         self._actual_context = self.get_context(method)
    247 
    248     def get_start_method(self, allow_none=False):

~\Anaconda3\envs\py37\lib\multiprocessing\context.py in get_context(self, method)
    236             return self._actual_context
    237         else:
--> 238             return super().get_context(method)
    239 
    240     def set_start_method(self, method, force=False):

~\Anaconda3\envs\py37\lib\multiprocessing\context.py in get_context(self, method)
    190             ctx = _concrete_contexts[method]
    191         except KeyError:
--> 192             raise ValueError('cannot find context for %r' % method) from None
    193         ctx._check_available()
    194         return ctx

ValueError: cannot find context for 'fork'
@HiddenBeginner
Copy link

I temporarily fixed the problem by modifying the script

multiprocessing.set_start_method("fork", force=True)

in l5kit.dataset.select_agents.py to

multiprocessing.set_start_method("spawn", force=True)

Please note that it may not be the right solution.

@lucabergamini lucabergamini self-assigned this Sep 1, 2020
@lucabergamini lucabergamini added the bug Something isn't working label Sep 1, 2020
@lucabergamini
Copy link
Contributor

Hey, we are aware of the issue. I've started #124 to ensure fork is only used on macOS (it was causing a deadlock there on python 3.8)

@lucabergamini
Copy link
Contributor

#124 has been merged and should fix this. I'm closing this for now but feel free to reopen it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants