Skip to content
Home » How to Install PyTorch on Windows 11/10

How to Install PyTorch on Windows 11/10

How to Install PyTorch on Windows

The post will show how you can install PyTorch in Windows 11/10. PyTorch is an open source Machine Learning framework that uses Python programming language and the Torch library. The framework can speed up the process of researching, prototyping and deploying projects. Keep reading this post to learn how you can install it on your Windows PC.

What are the System Requirements for PyTorch?

Before installing PyTorch, you need to ensure that your computer meets the following requirements:

  • Latest build of Windows 11/10
  • Python 3.6 and later
  • Compatible NVIDIA GPU
  • At least 8GB of RAM and 10 GB of Hard Disk space

How to Install PyTorch on Windows 11/10?

Follow these steps to start installing PyTorch in Windows:

1. Start by downloading and installing Python.

2. Next, open Anaconda’s official website and download and install its 64-bit version.

3. Once installed, click Start, search Anaconda PowerShell Prompt, and select Run as Administrator.

4. Type these commands and hit Enter to check Python and Anaconda’s version:

python --version
conda --version

Install PyTorch on Windows

5. Open PyTorch’s official website to download and install packages from binaries via Conda.

6. Scroll down, select the relevant installation details and download the package. Here are the details:

  • PyTorch build: Stable.
  • Your OS: Windows
  • Package: Conda
  • Language: Python
  • Compute Platform: CPU

Install PyTorch on Windows

7. A code will appear Once you’ve selected the following options. Copy that code and run it in the Anaconda PowerShell Prompt. The code will be:

conda install pytorch torchvision torchaudio cpuonly -c pytorch

Install PyTorch

8. Sit back and relax as the command executes. This may take some time, depending on your internet connection.

9. Once the command is done running, restart the Anaconda PowerShell Prompt as an Admin and run the following command to verify the installation.

import torch
x = torch.rand(2, 3)

Verify Installation

10. The output should be a 5×3 tensor. The numbers might differ, but they should be similar to the image below.

Does PyTorch support Windows 11?

Yes, PyTorch does support Windows 11. So, if you own a Windows 11 and want to use PyTorch for deep learning tasks, you can do so easily.

How to install PyTorch in Windows 10?

To install PyTorch on your Windows device, install Python and Anaconda. Then open the Anaconda Powershell Prompt as an Administrator and run this command:
conda install pytorch torchvision torchaudio cpuonly -c pytorch

Leave a Reply

Your email address will not be published. Required fields are marked *