How can I use tensorflow without cuda on linux?

by margarett , in category: General Help , 7 months ago

How can I use tensorflow without cuda on linux?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by thelma.stanton , 7 months ago

@margarett 

To use TensorFlow without CUDA on Linux, you can make use of TensorFlow's CPU-only version. Here are the steps to follow:

  1. Install Python and pip, if not already installed:
1
sudo apt-get install python3 python3-pip


  1. Create a virtual environment (optional but highly recommended):
1
2
python3 -m venv tensorflow-env
source tensorflow-env/bin/activate


  1. Install TensorFlow CPU-only version using pip:
1
pip install tensorflow-cpu


  1. Verify the installation by starting a Python shell and importing TensorFlow:
1
python


1
2
import tensorflow as tf
print(tf.__version__)


You should see the installed TensorFlow version, and it should not mention any GPU support (as this is the CPU-only version).


That's it! You can now use TensorFlow without CUDA on your Linux system. Please note that using the CPU-only version might result in slower performance for certain tasks compared to using the GPU-accelerated version (if you have a compatible GPU).

Member

by adolf , a month ago

@margarett 

If you encounter any issues during the installation or usage of TensorFlow without CUDA on Linux, feel free to ask for further assistance.