ValueError multiprocessing_context

Hi,
I have an error in running the program. I use the last version of openNMT-py, python 3.7.15 and pytorch 1.12:

line 406, in multiprocessing_context
‘multiprocessing_context={!r}’).format(valid_start_methods, multiprocessing_context))
ValueError: multiprocessing_context option should specify a valid start method in [‘spawn’], but got multiprocessing_context=‘fork’

Can someone help me?

this is because you are on Windows or MacOS.

use num_workers=0 in your config to avoid multi_processing.

1 Like