python并行计算 [joblib] Attempting to do parallel computing without protecting。。。
来源:互联网 发布:改手机号码软件 编辑:程序博客网 时间:2024/06/06 04:17
Under Windows, it is important to protect the main loop of code to avoid recursive spawning of subprocesses when using joblib.Parallel. In other words, you should be writing code like this:
import ....def function1(...): ...def function2(...): ...... if __name__ == '__main__': # do stuff with imports and functions defined about ...
这是必要的,因为Windows没有fork()。由于这个限制,Windows需要在它生成的所有子进程中重新导入您的主模块,以便在子进程中重新创建父进程。这意味着,如果您有在模块级生成新进程的代码,那么它将在所有子进程中递归地执行。if名称==“main”用于防止模块范围内的代码在子进程中被重新执行。这在Linux上是不必要的,因为它有fork(),它允许它派生一个维护相同状态的子进程,而不需要重新导入主模块。
https://stackoverflow.com/questions/29545605/why-is-it-important-to-protect-the-main-loop-when-using-joblib-parallel
阅读全文
0 0
- python并行计算 [joblib] Attempting to do parallel computing without protecting。。。
- python:并行化网格搜索中ImportError: [joblib] Attempting to do parallel computing without protecting...
- python报错ImportError: [joblib] Attempting to do parallel computing without protecting
- python进行KMeans聚类算法raise ImportError('[joblib] Attempting to do parallel computing ' ImportError: [jo
- 并行计算概述 (Introduction to Parallel Computing)
- 并行计算(Parallel Computing)初步认识
- Parallel Python 并行计算
- 并行计算介绍(Introduction to Parallel Computing ) ——我主张阅读英文原著
- 构建局域网下并行计算(parallel computing)环境
- 构建局域网下并行计算(parallel computing)环境
- matlab并行运算(parallel computing)
- Introduction to Parallel Computing
- Parallel Python(PP)并行计算测试
- 分布式并行计算方案:parallel computing by kafka-storm 发布了
- ArrayFire:高性能并行计算软件库 ArrayFire: a high performance software library for parallel computing
- Parallel Python多核并行
- C# Parallel 并行计算测试
- python平行(3):【parallel python】与【sklearn joblib的parallel和delayed】性能对比
- struts2_3
- CodeForces
- sdut-1118 C语言实验——从大到小输出a、b、c(选择结构)
- 八皇后问题
- DOM
- python并行计算 [joblib] Attempting to do parallel computing without protecting。。。
- java多态详解(接口指向实现类)
- 3.html5建立超链接
- C++ 参数指针传递、引用传递、值传递的区别
- win10正式版无法输入中文汉字怎么办
- RetroScope工具:执行流程分析
- SpringMVC(二五) JSTL View
- 线程入口地址 类封装
- B族维生素大全及控糖作用