Search code examples
pythonpython-3.xpytorch

Trying to install the latest Pytorch (1.13.1) instead installs 1.11.0


I'm trying to install the latest Pytorch version, but it keeps trying to instead install 1.11.0. I'm on Windows 10 running Python 3.10.8, and I have CUDA 11.6 installed.

I'm running the following command:

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

Even if I give it the flag --no-cache-dir, it proceeds to download 1.11.0 anyways. Running

pip install torch==1.13.1

Installs the CPU version. Any way that I can download the specific module directly and install it manually?


Solution

  • Figured it out. I ran the following command to specifically install the version I wanted:

    pip install https://download.pytorch.org/whl/cu116/torch-1.13.1%2Bcu116-cp310-cp310-win_amd64.whl
    

    You can find all the available wheels here. If you get involving "UserWarning: Failed to load image Python extension", make sure you also install Torchvision AT THE SAME TIME as PyTorch.