In init.py of metrics there is the following code:
from multiprocessing import Manager
manager_ = Manager()
which cause the following error when I try to run a diarization error measurement from command line using the famous if __name__=='__main__' :
File "c:\GongResearch\Speech\diarization\src\evaluation\der.py", line 1, in
from pyannote.metrics.diarization import DiarizationErrorRate as PyAnnoteDiarizationErrorRate
File "C:\Users\hanan.shteingart\Anaconda3\lib\site-packages\pyannote\metrics__init.py", line 40, in
manager_ = Manager()
File "C:\Users\hanan.shteingart\Anaconda3\lib\multiprocessing\context.py", line 55, in Manager
m.start()
File "C:\Users\hanan.shteingart\Anaconda3\lib\multiprocessing\managers.py", line 479, in start
self._process.start()
File "C:\Users\hanan.shteingart\Anaconda3\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Users\hanan.shteingart\Anaconda3\lib\multiprocessing\context.py", line 313, in _Popen
return Popen(process_obj)
File "C:\Users\hanan.shteingart\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 34, in init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\hanan.shteingart\Anaconda3\lib\multiprocessing\spawn.py", line 144, in get_preparation_data
_check_not_importing_main()
File "C:\Users\hanan.shteingart\Anaconda3\lib\multiprocessing\spawn.py", line 137, in _check_not_importing_main
is not going to be frozen to produce an executable.''')
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
I have seen the comment in the code saying:
# Note: if you (yes, you!) know a better way to do this,
# please open a pull request.
# I had to use this global multiprocessing manager for it to be accessible
# from anywhere, and make parallel computation of evaluation metric a reality
But there is probably a workaround to run this from command line, is there?
In init.py of metrics there is the following code:
which cause the following error when I try to run a diarization error measurement from command line using the famous
if __name__=='__main__'
:I have seen the comment in the code saying:
But there is probably a workaround to run this from command line, is there?