安装keras和tensorflow之后,python脚本因Segmentation Fault(崩溃的核心)崩溃

时间:2019-07-22 14:35:16

标签: python-3.x tensorflow ubuntu-16.04

enter image description here为什么只有在处理了故意的异常之后,import语句(最终导致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包

有人可以建议如何找到问题吗?

requirements.txt

jsonpickle
matplotlib
seaborn
numpy
pycos
jsonpickle
statsmodels
pandas
sklearn
pymongo
keras
tensorflow==2.0.0-beta1

1 个答案:

答案 0 :(得分:0)

结果是pycos执行了一个底层的调度程序,如果调用pycos的python模块暴露在各自python子程序包的_ _ init _ _.py中,则会以某种方式干扰Tensorflow(导致seg错误)。

从MonitoringSimulation / _ _ init _ _ _.py中删除monitoringSimulation / monitor.py等导入即可解决此问题。

将向pycos提交错误,因为我最终将需要将monitor.py模块暴露给其他子软件包。