Print this article Edit this article
Setup TensorFlow in Windows Server with GPU
1. Create a conda environment
Open windows menu and find & click on "Anaconda Powershell Prompt (Anaconda3)":
Create a new conda environment named tf with the following command.
conda create --name tf python=3.9
You can deactivate and activate it with the following commands.
conda deactivate
conda activate tf
Make sure it is activated for the rest of the installation.
2. GPU setup
Then install the CUDA, cuDNN with conda.
conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
3. Install TensorFlow
TensorFlow requires a recent version of pip, so upgrade your pip installation to be sure you're running the latest version.
python -m pip install --upgrade pip
Then, install TensorFlow with pip.
Note: Do not install TensorFlow with conda. It may not have the latest stable version. pip is recommended since TensorFlow is only officially released to PyPI.
# Anything above 2.10 is not supported on the GPU on Windows Native
pip install "tensorflow<2.11"
If still for more than 2 min without returning to the prompt, hit ENTER.
4. Verify the installation
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"
If a list of GPU devices is returned, you've installed TensorFlow successfully.
Last Modified:
Feb 13, 2024 2:06 pm US/Eastern
Created:
Feb 13, 2024 1:49 pm US/Eastern
by
calderon
JumpURL: https://eng.purdue.edu/jump/2fe5ad8