標題: Yolov8 PyTorch出現 An attempt has been made to start a new process before t... [打印本頁] 作者: woff 時間: 2023-9-28 17:32 標題: Yolov8 PyTorch出現 An attempt has been made to start a new process before t... 最近從新調試一段pytorch 程式碼,以前的伺服器上完全沒問題,但換了一台機器,重新安裝了新版本的cuda, anaconda ,pytorch 等,以前的程式碼出現各種版本不適合的問題。
問題:
現在說說這個問題。運行pytorch 時出現的情況如下:
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.