cleanvision
cleanvision copied to clipboard
RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase
File "/opt/homebrew/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/spawn.py", line 164, in get_preparation_data
_check_not_importing_main()
File "/opt/homebrew/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/spawn.py", line 140, in _check_not_importing_main raise RuntimeError(''' 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.
To fix this issue, refer to the "Safe importing of main module"
section in https://docs.python.org/3/library/multiprocessing.html
Hi @csv610 ! Could you give more context? What were you trying to run and stacktrace related to cleanvision code?
Hi @csv610 ! This might be caused by the multiprocessing library. Could you try executing the code inside of a main block like this
if __name__ == "__main__":
imagelab = Imagelab(data_path)
imagelab.find_issues()
FYI you can also try: imagelab.find_issues(..., n_jobs = 1)
to disable multiprocessing entirely.