-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
ValueError: cannot find context for 'fork' when processor_with_lm.batch_decode(_logits) #16898
Comments
Related woven-planet/l5kit#129 |
Hey @elsheikh21, Let's try to narrow the bug further down :-) Does the following work for you: from multiprocessing import get_context
pool = get_context("fork").Pool(num_processes)
pool.close() ? |
Hello @patrickvonplaten I have tried to run from multiprocessing import get_context
num_processes = 8
pool = get_context("fork").Pool(num_processes)
pool.close() and got the following traceback
System Information |
I have read this thread, yet the error itself occurs when I call processor.batch_decode and I am working on the project not just to be used on my local device only |
This seems to be the error then. Could you try to replace |
If |
I have tried to run with |
Think we can just replace |
Yes, I would happily do that, I guess it would be something along those lines? please feel free to modify my approach. Otherwise I will start reading about collaborating and how to open PR try:
pool = get_context("fork").Pool(num_processes)
except ValueError as exc:
if "cannot find context for 'fork'" in exc:
pool = get_context("spawn").Pool(num_processes)
logging.info("Switching to \"spawn\" as \"fork\" context is not found") |
I think we can actually just change |
Okay let us do it your way then, I have also created a custom dataset loader (from flac/wav audio files) and model finetuner, evaluator if those can be helpful for the community I would love to share them as well For now I will open a PR for |
Exactly same problem here, also trying to run this under Windows 10 and getting the same error, when in processing_wav2vec2_with_lm.py, line 316, gets "fork" from context. |
as a quick fix you can replace "fork" with "spawn" in the line |
@ADD-eNavarro @elsheikh21 sorry I don't work with Windows usually and am a bit buried with other issues. Regarding the PR please lemme know if anything isn't clear, happy trying to be more precise - in short I think we should try to apply the exact same solution that was applied in |
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread. Please note that issues that do not follow the contributing guidelines are likely to be ignored. |
System Info
Who can help?
@patrickvonplaten
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
To reproduce
The model I am using (Wav2Vec2.0 Large XLS-R 53 English):
Steps to reproduce the behavior:
.wav
file(s)Code snippet
Expected behavior
The text was updated successfully, but these errors were encountered: