tensorflow: importing tensorflow gives error "illegal instruction"

Hi… I am trying to install tensorflow in my python3 virtual environment. OS- centos 7.8kvm tensorflow installed from binary tensorflow version 1.15.0 python version 3.6.8 installed in virtualenv using pip with the command TMPDIR=/data/vincents/ pip install --cache-dir=/data/vincents/ --build /data/vincents/ tensorflow==1.15.0 I have 2GB RAM and I am using 2GB swap memory

this is my CPU info Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 2 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 13 Model name: QEMU Virtual CPU version 2.5+ Stepping: 3 CPU MHz: 2397.222 BogoMIPS: 4794.44 Hypervisor vendor: KVM Virtualization type: full L1d cache: 32K L1i cache: 32K L2 cache: 4096K L3 cache: 16384K NUMA node0 CPU(s): 0,1 Flags: fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl xtopology eagerfpu pni cx16 x2apic hypervisor lahf_lm

I have succeeded to install tensorflow=1.15.0, but whenever I try to import it in a python shell in throws error illegal instruction 106207928_274334003654354_6896801223456467874_n

DO I NEED TO UPGRADE MY SERVER TO 4CPU? OR IS THERE SOME OTHER PROBLEM?

N.B: I CANNOT SWITCH TO ANY OTHER VERSION. I NEED EXACTLY THIS VERSION

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 29 (9 by maintainers)

Most upvoted comments

I updated the gcc version but it didn’t help. So I switched environment. Previously I was working in a python3 environment, I started using anaconda environment. Installed tensorflow using conda, and it’s working.

It seems to me the failure gcc: error trying to exec 'cc1plus': execvp: No such file or directory is there because g++ was not installed or properly configured.

@AnikaTabassum cd tensorflow before git switch .... BTW, since you are running qemu, it might be possible to turn on AVX. See qemu menu

There was the same problem to me, but version dependencies made it difficult to solve this problem previously. I recommend you upgrading the CPU.

from the TensorFlow installation guide, you need AVX.

Starting with TensorFlow 1.6, binaries use AVX instructions which may not run on older CPUs.