jupyter notebook用不了multiporcessing的问题

在跑一本drl书中的代码遇到这个问题,到书的github页面看到别人也有类似的问题

搬运答案

Had the same issue, this is because multiprocessing does not work natively inside a Jupyter notebook. For details see this StackOverflow discussion (specifically Eden Trainor’s answer):
有同样的问题,这是因为多处理在 Jupyter 笔记本中无法本机工作。有关详细信息,请参阅此 StackOverflow 讨论(特别是 Eden Trainor 的回答):
https://stackoverflow.com/questions/48846085/python-multiprocessing-within-jupyter-notebook

Apparently someone has created a similar library to multiprocessing called multiprocess which works inside jupyter notebooks. However, I suggest the authors (@azai91) either put a !pip install multiprocess in the notebook for this, or add a comment saying to run it from an IDE like Spyder. Since the multiprocess library has its own problems (had to re-import numpy inside the process) probably would go for the latter option.
显然,有人创建了一个与多处理类似的库,称为多进程,该库在 jupyter 笔记本中工作。但是,我建议作者 () 为此在笔记本中放置一个 !pip install 多进程,或者添加一条注释,说从 Spyder 等 IDE 运行它。由于多进程库有其自身的问题(必须在进程中重新导入numpy),因此可能会选择后一种选择。

主要是进程改线程
或者专门下一个multiprocess库 但会有些小问题

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值