Takeshi
Takeshi

Reputation: 41

Error while importing TensorFlow: Illegal instruction (core dumped)

I installed tensorflow following the instructions on their site, but when I try to run import tensorflow as tf I get the following error: Illegal instruction (core dumped). I tried this with the CPU and GPU versions, using Virtualenv and "native" pip, but the same error occurs in every case.

The parameters of my PC:
OS : LinuxMint 18.3
CPU: AMD Athlon Dual Core 4450e
GPU: GTX 1050 Ti

I found that some people experienced this error when they compiled tensoflow from source and misconfigured some flags. Could it be that my CPU is too old and not supported? Is it possible that compiling from source solves this issue?

Upvotes: 3

Views: 4212

Answers (3)

Jimmy
Jimmy

Reputation: 11

Another quick workaround is to use conda: conda install tensorflow. The conda version is potentially more efficient than the official one, according to this blog.

Upvotes: 1

Laurent S
Laurent S

Reputation: 4326

There is an issue on tensorflow that seems to indicate the tf versions > 1.5.0 are now built to use Intel AVX instructions. If you have a CPU that doesn't support these instructions, you will likely get the problem described here.

Fixes include building tf from source or downgrading to tensorflow(-gpu)==1.5.0.

Upvotes: 4

Takeshi
Takeshi

Reputation: 41

Compiling tensorflow from source solved the problem, so it seems my system wasn't supported.

Upvotes: 1

Related Questions