# Windows 11 — TensorFlow GPU Installation ### Links * Official TF installation guide: [https://www.tensorflow.org/install/pip](https://www.tensorflow.org/install/pip) * Video tutorial: [https://www.youtube.com/watch?v=eErbMsP8v9I](https://www.youtube.com/watch?v=eErbMsP8v9I) * protobuf compatibility https://stackoverflow.com/questions/76641641/is-there-any-reference-to-tensorflow-datasets-compatibility-chart-specifically --- ## 1. Clean up old environment(optional) ```text conda deactivate conda env remove -n tf -y conda env list ``` --- ## 2. Create a fresh Conda environment ```text conda create -n tf python=3.9 -y conda activate tf ``` --- ## 3. Install CUDA + cuDNN (Conda versions compatible with TF 2.10) ```text conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0 -y ``` --- ## 4. Install required Python packages ```text pip install notebook pip install tensorflow==2.10.1 pip install numpy==1.26.4 pip install "protobuf==3.20" --force-reinstall pip install "grpcio<=1.48" --force-reinstall pip install tensorflow-addons==0.18.0 pip install numpy==1.26.4 ``` --- ## 5. Remember to **Reload Window** in VS Code After installing packages, reload VS Code to ensure that Jupyter kernels and Python executables correctly detect the newly installed packages.  --- ## 6. About the *protobuf* version conflict I frequently encountered the protobuf installation warning: * TensorFlow 2.10 requires **protobuf < 3.20** * But *tensorflow_datasets* usually prefers a newer protobuf version * I found that installing **protobuf==3.20** surprisingly works fine for both packages It was a strange conflict, but installing exactly `3.20.0` resolved the issue.  --- ## 7. Test your installation Use this script to verify all package versions and GPU availability: ```python import tensorflow as tf import tensorflow_addons as tfa import tensorflow_datasets as tfds import numpy as np import importlib.metadata as importlib_metadata def get_version(pkg_name: str) -> str: """Safely return package version, or '(not installed)' if missing.""" try: return importlib_metadata.version(pkg_name) except importlib_metadata.PackageNotFoundError: return "(not installed)" print("TF version:", tf.__version__) print("TFA version:", tfa.__version__) print("TFDS version:", tfds.__version__) print("NumPy version:", np.__version__) print("protobuf:", get_version("protobuf")) print("GPU devices:", tf.config.list_physical_devices("GPU")) ``` ### ✔️ Expected output example: ``` TF version: 2.10.1 TFA version: 0.18.0 TFDS version: 4.9.2 NumPy version: 1.26.4 protobuf: 3.20.0 GPU devices: [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')] ``` ### modify conda activation script C:/ProgramData/anaconda3/Scripts/activate
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up