2

I need a TensorFlow version 2> and I installed that on my Ubuntu Server, but it gives me the AVX error. I tried the 1.5 version and it works but doesn't support Keras and the other commands I used. I am using python3.5. There are no errors in the code.

OS: Ubuntu Server on a Server with 16GB ram Pip: 19.0 Python: 3.5.9

  • 3
    When you say "the AVX error", do you mean it's *warning* you that AVX is available but Tensorflow wasn't compiled to take advantage of it? Or do you mean it crashes with SIGILL? Or does recent Tensorflow check CPUID and let you know instead of just crashing? This would be a better question if you quote the exact message so other people can find it when searching. – Peter Cordes Jul 06 '20 at 03:39
  • No, so it says Illegal Instruction (Core Dumped) and then exits whenever I import TensorFlow. – DragonflyRobotics Jul 06 '20 at 19:36
  • I tried the precompiled ones but it says that this wheel is not supported by your platform. – DragonflyRobotics Jul 06 '20 at 19:37

1 Answers1

4

To fix this, you can install TensorFlow via anaconda and not pip. It work for me by doing this. If anybody knows why, they are welcome to explain.

  • Obviously one pre-built binary was compiled to assume AVX support (and thus crash on CPUs without), the other wasn't (works everywhere, but doesn't get a benefit from running on CPUs that have AVX available.) It might be documented somewhere which was built which way... – Peter Cordes Jul 08 '20 at 09:39
  • 1
    Using Miniconda fix the problem too (see https://docs.conda.io/projects/continuumio-conda/en/latest/user-guide/install/windows.html). – Stephan Jul 23 '20 at 16:39
  • Thx this is a lot better than building tensorflow from source https://stackoverflow.com/questions/54541969/tensorflow-compile-runs-forever ... – Greg7000 Mar 10 '21 at 18:11