python-3.x - 安装 keras 和 tensorflow 后,python 脚本因 Segmentation Fault (core dumped) 而崩溃
问题描述
为什么导入语句(最终导致 keras 导入)仅在处理故意异常后才起作用???????
我有一个带有多个 main.py 入口点的 python3.5 项目。
一个入口点在服务器上运行,另一个在客户端上使用 pycos 进行通信(网络 IPC)。
我的 server/main.py 曾经执行得很好,但是在安装了 keras 和 tensorflow 之后
pip install -r requirements.txt --user
server/main.py 崩溃读取
Using TensorFlow backend.
Segmentation fault (core dumped)
我已经监控了服务器 VM 上的 RAM、硬盘空间,但没有任何迹象表明 server/main.py 崩溃了……它甚至没有在导入跟踪中导入 keras 或 tensorflow。我猜 _ init _.py 导入跟踪最终会导致导入 keras / tensorflow 包的模块
谁能建议如何找到问题?
要求.txt
jsonpickle
matplotlib
seaborn
numpy
pycos
jsonpickle
statsmodels
pandas
sklearn
pymongo
keras
tensorflow==2.0.0-beta1
解决方案
事实证明,如果调用 pycos 的 python 模块暴露在它们各自 python 子包的 _ _ init _ _.py 中,pycos 会执行一个底层调度程序,该调度程序会以某种方式干扰 Tensorflow(导致 seg 错误)。
删除 monitoringSimulation/monitor.py 等。从 monitoringSimulation/ _ _ init _ _.py 导入解决了这个问题。
将向 pycos 提交一个错误,因为我最终需要将 monitor.py 模块暴露给其他子包。
推荐阅读
- javascript - 使用 vanilla javascript 按钮而不是 html href 触发 href
- sql - Oracle/SQL - 按月划分的销售额
- corda - 在 Corda 中,节点是否检查它们收到的消息是否来自网络映射中列出的对方节点的 IP 地址?
- python - 我怎样才能找到virtualenv python的路径
- typescript - Cypress.io + TypeScript。测试开始时的断言调用
- react-native - 对话框显示时反应本机 - 持久键盘
- pyspark - 将列附加到 pyspark 数据框
- python - dask.read_parquet 导致 OOM 错误
- c# - 文件查找和压缩后在最后一行获得额外空间
- c# - 如何在 viewModel 中使用模型