在Python中导入张量流时的非法指令 [英] Illegal instruction when import tensorflow in Python
问题描述
我正在尝试在VPS的shell中运行python程序CentOS 7.0 x64
I am trying to run python program in shell, CentOS 7.0 x64, on VPS
python3版本是3.6.4
python3 version is 3.6.4
pip3版本是9.0.1
pip3 version is 9.0.1
当我使用 pip3冻结
时,它的 tensorflow == 1.6.0
xx.py
的第一行是导入张量流
是否使用 python3 xx.py
或在python3 shell中键入 import tensorflow
,结果是非法指令
whether I use python3 xx.py
or type import tensorflow
in python3 shell, it turns out to be Illegal instruction
此外,任何其他导入,例如 import numpy
, import sklearn
都运行良好,没有问题他们
Besides, any other import like import numpy
, import sklearn
function well, nothing wrong with them
如何解决这个问题?
推荐答案
TensorFlow 1.6开始使用现代CPU的AVX功能:
https://github.com/ tensorflow / tensorflow / releases / tag / v1.6.0
TensorFlow 1.6 started using AVX feature of modern CPUs: https://github.com/tensorflow/tensorflow/releases/tag/v1.6.0
降级到1.5:
pi p install tensorflow == 1.5
这篇关于在Python中导入张量流时的非法指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!