其他分享
首页 > 其他分享> > 异常1:RuntimeError An attempt has been made to start a new process

异常1:RuntimeError An attempt has been made to start a new process

作者:互联网

一、异常1:RuntimeError: An attempt has been made to start a new process

在这里插入图片描述

原因:多进程需要在main函数中运行

解决方法1:

​ 加main函数,在main中调用

if __name__ == '__main__':
	main()

解决方法2:

​ num_workers改为0,单进程加载

ers改为0,单进程加载

标签:__,made,attempt,process,RuntimeError,been,start,main
来源: https://blog.csdn.net/weixin_43529465/article/details/121766535