Skip to main content

Install TensorFlow on Windows 11: Step-by-Step Guide for CPU & GPU

 ---

Installing **TensorFlow on Windows 11** requires setting up system dependencies, configuring Python, and ensuring compatibility with CPU or GPU acceleration. This step-by-step guide provides everything needed to install **TensorFlow 2.10 or lower** on **Windows Native**, including software prerequisites, Microsoft Visual C++ Redistributable installation, Miniconda setup, GPU driver configuration, and verification steps.  


### **System Requirements:**  

Before installing TensorFlow, ensure your system meets these requirements:  

- **Operating System:** Windows 7 or higher (64-bit)  

- **Python Version:** 3.9–3.12  

- **pip Version:** 19.0 or higher for Linux and Windows, 20.3 or higher for macOS  

- **Microsoft Visual C++ Redistributable:** Required for Windows Native  

- **Long Paths Enabled:** Ensure long paths are enabled in Windows settings  


For **GPU support**, install:  

- **NVIDIA GPU drivers**: ≥ 525.60.13 (Linux) / ≥ 528.33 (WSL on Windows)  

- **CUDA Toolkit**: Version 12.3  

- **cuDNN SDK**: Version 8.9.7  

- **(Optional) TensorRT**: To enhance model inference performance  


### **Step 1: Install Microsoft Visual C++ Redistributable**  

TensorFlow requires **Microsoft Visual C++ Redistributable** for Visual Studio 2015, 2017, and 2019.  

- Visit the official **Microsoft Visual C++ Redistributable** download page.  

- Scroll to **Visual Studio 2015, 2017, and 2019** section.  

- Download and install the correct version for your system (x64).  


### **Step 2: Install Miniconda**  

Miniconda is the recommended package manager for TensorFlow installation.  

- Download **Miniconda for Windows (64-bit)**.  

- Double-click the installer and follow the installation steps.  


### **Step 3: Create a Conda Environment**  

To prevent dependency conflicts, create a **dedicated environment** for TensorFlow:  

```sh

conda create --name tf python=3.9

conda activate tf

```  

Ensure the new environment is **activated** before proceeding.  


### **Step 4: Install GPU Dependencies (Optional)**  

For TensorFlow GPU acceleration, install:  

1. **NVIDIA GPU drivers**  

2. **CUDA and cuDNN** via Conda:  

   ```sh

   conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0

   ```  

3. Verify GPU installation using:  

   ```sh

   python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

   ```  


### **Step 5: Install TensorFlow**  

First, upgrade `pip` to the latest version:  

```sh

pip install --upgrade pip

```  

Then install TensorFlow:  

```sh

pip install "tensorflow<2.11"

```  

⚠ **Important:** Versions **above 2.10 do not support Windows GPU natively**.  


### **Step 6: Verify TensorFlow Installation**  

#### **For CPU Verification:**  

Run the following command:  

```sh

python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

```  

If a tensor value appears, TensorFlow is correctly installed.  


#### **For GPU Verification:**  

Run the command:  

```sh

python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

```  

If a list of **GPU devices** appears, TensorFlow is using your **NVIDIA GPU** successfully.  


### **Conclusion**  

This guide provides a **detailed walkthrough** for installing TensorFlow on **Windows 11**, covering **CPU and GPU configurations**, necessary dependencies, and post-installation verification. By following these steps, you can ensure a **stable and optimized TensorFlow environment** for deep learning projects.


### Links:

https://github.com/Sivatech24/Ultimate-Software-Installation-Setup-Guide-Tutorials-Demos/blob/main/Install%20TensorFlow%20on%20Windows%2011%3A%20Step-by-Step%20Guide%20for%20CPU%20%26%20GPU.md


https://www.tensorflow.org/install/pip


https://www.tensorflow.org/install/pip#windows-native_1


https://pypi.org/project/tensorflow-gpu/


https://www.nvidia.com/en-sg/data-center/gpu-accelerated-applications/tensorflow/


Comments

Popular posts from this blog

Stable Diffusion WebUI 1.10.1 Full Installation Guide | AUTOMATIC1111 | Windows 11

Stable Diffusion WebUI 1.10.1 Full Installation Guide | AUTOMATIC1111 | Windows 11  Welcome to this step-by-step Stable Diffusion WebUI 1.10.1 installation guide! In this tutorial, we will walk you through the complete setup process on Windows 11 , including downloading and installing Git , setting up Python 3.10.6 , cloning the AUTOMATIC1111 repository , and configuring .gitignore for a clean and efficient installation. By following this guide, you’ll be able to generate AI-generated images using Stable Diffusion with ease. Whether you're new to AI image generation or an experienced user, this guide ensures that your setup is optimized for performance and stability. 🔗 Required Downloads: Before we begin, make sure to download the following tools: ✅ Git for Windows – Download Here ✅ Stable Diffusion WebUI (AUTOMATIC1111) – Download Here ✅ Python 3.10.6 – Download Here 🛠️ Step-by-Step Installation Process 1️⃣ Install Git for Windows Git is required to clone the ...

Unreal Engine Product Showcase: Mesmerizing Video Sequence Render

  4k Image: