Illegal instruction(core dumped) tensorflow

Issue

I am importing tensorflow in my ubuntu python
using following commands-

$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Illegal instruction (core dumped)

And the program exits.
Please specify the solution.

Solution

I had the same problem and had to downgrade tensorflow to 1.5.0:

pip uninstall tensorflow
pip install tensorflow==1.5.0

Edit: As @Tobsta points out in the comments, the other option is to compile the binaries from source. The precompiled binaries of versions >1.5 use AVX instructions that are not supported by older CPUs

Answered By – SheepPerplexed

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published