Niamh McCann
Niamh McCann

Reputation: 51

Does tensorflow need GPU

I am trying to install TensorFlow on Linux, Ubuntu 18.10 by following these instructions: https://www.tensorflow.org/install/
I am using python 2.7

I first tried to install it using the pip package and after:

pip install --user --upgrade tensorflow  # install in $HOME

I got a message to say that tensorflow 1.12.0 was successfully installed, however when I did the next line:

python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

I got the error

The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine

I then tried to build from source and it failed when I tried to checkout the current branch

bazel test -c opt -- //tensorflow/... -//tensorflow/compiler/... -//tensorflow/lite/...

I skipped the GPU steps as this said optional but am wondering if it is needed?

Upvotes: 3

Views: 6758

Answers (2)

Xan
Xan

Reputation: 77523

The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine

Of note that this is a warning only and would not stop TF from running proprely.

TF version you can install from PIP is compiled to be usable on a broad range of systems, but TF can be compiled with system-specific optimizations from source. This warning is intended to remind you of it.

See also https://github.com/tensorflow/tensorflow/issues/7778

Upvotes: 1

Matt Camp
Matt Camp

Reputation: 1528

Not 100% certain what you have going on but in short no Tensorflow does not require a GPU and you shouldn't have to build it from source unless you just feel like it.

Might I suggest you try uninstalling whatever version of Tenforflow you might have, and then reinstall it.

# Try both of these just to be safe
pip uninstall tensorflow
pip uninstall tensorflow-gpu 

# I recommend using conda when possible 
conda install tensorflow

# but if you don't have conda then pip will work just fine
pip install tensorflow

Upvotes: 3

Related Questions