当前位置:网站首页>Pytorch: runtimeerror: an attempt has been made to start a new process Error reporting (resolved)

Pytorch: runtimeerror: an attempt has been made to start a new process Error reporting (resolved)

2022-04-23 21:01:00 Top of the program

PyTorch appear :RuntimeError: An attempt has been made to start a new process… Report errors ( resolved )

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.

Reference resources https://blog.csdn.net/u014546828/article/details/109235539

版权声明
本文为[Top of the program]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/111/202204210545090952.html