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. jupyter notebookmultiporcessing问题

    2024-04-23 16:14:02       30 阅读
  2. multiprocessing方法说明

    2024-04-23 16:14:02       41 阅读
  3. python多进程multiprocessing卡住问题

    2024-04-23 16:14:02       38 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-23 16:14:02       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-23 16:14:02       106 阅读
  3. 在Django里面运行非项目文件

    2024-04-23 16:14:02       87 阅读
  4. Python语言-面向对象

    2024-04-23 16:14:02       97 阅读

热门阅读

  1. Centos 7 安装 RocketMQ 5.14(保姆级)

    2024-04-23 16:14:02       34 阅读
  2. 鼠标手辅助器

    2024-04-23 16:14:02       35 阅读
  3. 第24篇 python基础

    2024-04-23 16:14:02       32 阅读
  4. 安装Python包常用的国内镜像源

    2024-04-23 16:14:02       30 阅读
  5. 宝塔手动安装grafana

    2024-04-23 16:14:02       30 阅读
  6. Flowable学习笔记一:初识Flowable

    2024-04-23 16:14:02       39 阅读
  7. GetManifestResourceStream用法

    2024-04-23 16:14:02       27 阅读
  8. MySQL数据库——18、事务

    2024-04-23 16:14:02       29 阅读
  9. AtomGit 体验

    2024-04-23 16:14:02       36 阅读
  10. Stable Diffusion 本地部署教程

    2024-04-23 16:14:02       32 阅读