1

I am trying to run python program in shell, CentOS 7.0 x64, on VPS

python3 version is 3.6.4

pip3 version is 9.0.1

when I use pip3 freeze it has tensorflow==1.6.0

The first line of xx.py is import tensorflow

whether I use python3 xx.py or type import tensorflow in python3 shell, it turns out to be Illegal instruction

Besides, any other import like import numpy, import sklearn function well, nothing wrong with them

How to solve this?

Litchy
  • 355
  • 1
  • 4
  • 18
  • Try using a virtualenv. – sytech Mar 06 '18 at 02:09
  • Can you import any order library besides tensorflow to see if the problem is with your python 3.6 installation in general or with tensorflow? This sounds like a python installation problem and not just virtual environment or tensorflow – Adnan S Mar 06 '18 at 02:42
  • @AhmedS yes I have imported others, all are ok except tensorflow. e.g. `sklearn, scipy, pandas` all function well – Litchy Mar 06 '18 at 10:59
  • @sytech I do not understand why the virtual python environment will help. Since this is not a version conflict. Could you please let me know the possible reason? – Litchy Mar 06 '18 at 13:01
  • @Litchy -- It's anecdotal, but I had the same error with certain packages on Mac OS/Python3.6 but the problem went away in a virtualenv, for reasons unknown to me at this time. – sytech Mar 06 '18 at 13:27
  • @sytech haha I tried and I still have the same problem. I guess your problem is that your previous package does not match the tensorflow dependencies, like numpy, etc. But mine, ..., I still do not know how to solve it T T – Litchy Mar 06 '18 at 14:02

1 Answers1

4

TensorFlow 1.6 started using AVX feature of modern CPUs: https://github.com/tensorflow/tensorflow/releases/tag/v1.6.0

Downgrade to 1.5: pip install tensorflow==1.5

Paweł Załuski
  • 498
  • 5
  • 12