Installing tensorflow-gpu in Conda

Check if your computer supports gpu (if nvidia processor, you can use the following.

nvidia-smi

You will see an output similar to the following (of course, the configurations will be different)

GPU Configuration

Make sure you remove the cpu version first

conda remove tensorflow

Then, install the gpu version

conda install tensorflow-gpu

Now let’s check if tensorflow gpu version is available from Python:

import tensorflow as tf
tf.test.is_gpu_available()

This should return True.

The above method is actually deprecated. You can get the list of GPUs to make sure that you are using the GPU version, not the CPU:

tf.config.list_physical_devices('GPU')

Let the power of GPU amaze you!

--

--

AI/Data Science Digest

One Digest At a Time. I value your time! #datascience #AI #GenAI #LLMs #dataanalyst #datascientist #probability #statistics #ML #savetime #digest