成功解决ImportError: [joblib] Attempting to do parallel computing without protecting your import on a sy
On 解决 to 成功 your import Do Without
2023-09-14 09:04:51 时间
成功解决ImportError: [joblib] Attempting to do parallel computing without protecting your import on a sy
目录
解决问题
ImportError: [joblib] Attempting to do parallel computing without protecting your import on a system that does not support forking. To use parallel-computing in a script, you must protect your main loop using "if __name__ == '__main__'". Please see the joblib documentation on Parallel for more information
解决思路
导入错误:[joblib]试图在不支持分叉的系统上执行并行计算而不保护导入。要在脚本中使用并行计算,您必须使用"if __name__ == '__main__'"来保护主循环。有关详细信息,请参阅并行的joblib文档。
tips:
1、凡是有调用方法的时候,均会出现该错误!
from sklearn.grid_search import GridSearchCV
因为sklearn.grid_search方法已经有所重构!
解决方法
在主程序最顶部加入主代码即可!
if __name__=='__main__': #主程序最顶端,加入此行代码即可
哈哈,大功告成!
相关文章
- share a story on OSPF & BGP
- Error This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. T
- the network bridge on device vmnet0 is not running解决方法
- [Python] Putting Code on PyPi
- ACFS-9459: ADVMACFS is not supported on oraclelinux-release-5-8.0.2 故障解决
- Android Studio解决unspecified on project app resolves to an APK archive which is not supported
- [PWA] Add Push Notifications to a PWA with React in Chrome and on Android
- 解决执行go get时报错的问题:dial tcp: lookup xxx.com on 8.8.8.8:53: no such host
- 解决docker network create --subnet报错的问题:Error response from daemon: Pool overlaps with other one on th
- [FAQ] docker-ce depends on containerd.io, docker-ce depends on docker-ce-cli
- SAP Kyma on top of Kubernetes的会议台词
- 成功解决The NVIDIA driver on your system is too old (found version 9010). Please update your GPU driver
- 成功解决The NVIDIA driver on your system is too old (found version 8000).Please update your GPU driver
- 成功解决RuntimeError: Java is not installed, or the Java executable is not on system path
- 成功解决sys:1: DtypeWarning: Columns (39,41,42,217) have mixed types.Specify dtype option on import or s
- 成功解决The NVIDIA driver on your system is too old (found version 9010). Please update your GPU driver
- 成功解决SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame See
- 已解决TypeError: cannot do slice indexing on Index with these indexers [1] of type int
- idea - 警告 The IDE is running low on memory and this might affect performance. Please consider increasing available heap. 解决
- Maven项目Run As无Run On Server的解决方法
- Ubuntu12挂载nfs文件系统报错:mount: wrong fs type, bad option, bad superblock on 198.168.1.x:/mnt/nfs,
- 大数据Hadoop之——Spark on Hive 和 Hive on Spark的区别与实现
- Docker出现 Error response from daemon: driver failed programming external connectivity on endpoint 解决
- 【python问题解决】---- sqlite3.OperationalError: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY