在Python中导入tensorflow时的非法指令

时间:2018-03-06 01:24:05

标签: python linux tensorflow centos

我试图在shell上运行python程序,CentOS 7.0 x64,在VPS上

python3版本是3.6.4

pip3版本是9.0.1

当我使用pip3 freeze时,它有tensorflow==1.6.0

xx.py的第一行是import tensorflow

我是否在python3 shell中使用python3 xx.py或输入import tensorflow,结果证明是Illegal instruction

此外,像import numpyimport sklearn这样的任何其他导入功能都很好,没有任何问题

如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

TensorFlow 1.6开始使用现代CPU的AVX功能: https://github.com/tensorflow/tensorflow/releases/tag/v1.6.0

降级为1.5: pip install tensorflow==1.5

相关问题