Torch documentation says use
pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
to install the latest version of PyTorch. This works when I do it manually but when I add it to req.txt and do pip install -r req.txt
, it fails and says ERROR: No matching distribution
.
Edit: adding the whole line from req.txt and error here.
torch==1.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.htmltorch==1.4.0+cpu
ERROR: Could not find a version that satisfies the requirement torch==1.4.0+cpu (from -r requirements.txt (line 1)) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.3.1, 0.4.0, 0.4.1, 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0)
ERROR: No matching distribution found for torch==1.4.0+cpu (from -r requirements.txt (line 1))
To install PyTorch via pip, and do have a CUDA-capable system, in the above selector, choose OS: Linux, Package: Pip, Language: Python and the CUDA version suited to your machine. Often, the latest CUDA version is better. Then, run the command that is presented to you.
To install PyTorch, you have to run the installation command of PyTorch on your command prompt. This command is available on https://pytorch.org/. Select language and cuda version as per your requirement. Now, run python -version, and Conda -version command to check Conda and python packages are installed or not.
You don't need to have cuda to install the cuda-enabled pytorch package but you need cuda to use it. We do not ship cuda with pytorch as it is a very big library.
Add --find-links
in requirements.txt
before torch
--find-links https://download.pytorch.org/whl/torch_stable.html
torch==1.2.0+cpu
Source: https://github.com/pytorch/pytorch/issues/29745#issuecomment-553588171
-f https://download.pytorch.org/whl/torch_stable.html
torch==1.4.0+cpu
-f https://download.pytorch.org/whl/torch_stable.html
torchvision==0.5.0+cpu
worked fine for me :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With