Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 775
Niamh McCann Avatar asked Apr 06 '26 17:04

Niamh McCann


1 Answers

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
like image 188
Matt Camp Avatar answered Apr 08 '26 17:04

Matt Camp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!