Error installing torch==1.8.0+cu111 in Colab.

huangapple go评论50阅读模式
英文:

Error installing torch==1.8.0+cu111 in Colab

问题

我正在尝试在Colab笔记本中安装带有CUDA支持的PyTorch(torch==1.8.0+cu111)。然而,在安装过程中出现了错误。这是触发错误的代码片段:

import subprocess

CUDA_version = 
展开收缩
).decode("UTF-8").split(", ") if s.startswith("release")][0].split(" ")[-1]
print("CUDA版本:", CUDA_version) if CUDA_version == "10.1": torch_version_suffix = "+cu101" elif CUDA_version == "10.2": torch_version_suffix = "+cu102" else: torch_version_suffix = "+cu111" # pip install torch==1.7.0 -f https://download.pytorch.org/whl/torch_stable.html !pip install torch==1.8.0{torch_version_suffix} torchvision==0.9.0{torch_version_suffix} -f https://download.pytorch.org/whl/torch_stable.html ftfy reg

给了我以下错误:

找不到满足要求torch==1.8.0+cu111的版本(从版本中找到:1.11.0、1.11.0+cpu、1.11.0+cu102、1.11.0+cu113、1.11.0+cu115、1.11.0+rocm4.3.1、1.11.0+rocm4.5.2、1.12.0、1.12.0+cpu、1.12.0+cu102、1.12.0+cu113、1.12.0+cu116、1.12.0+rocm5.0、1.12.0+rocm5.1.1、1.12.1、1.12.1+cpu、1.12.1+cu102、1.12.1+cu113、1.12.1+cu116、1.12.1+rocm5.0、1.12.1+rocm5.1.1、1.13.0、1.13.0+cpu、1.13.0+cu116、1.13.0+cu117、1.13.0+cu117.with.pypi.cudnn、1.13.0+rocm5.1.1、1.13.0+rocm5.2、1.13.1、1.13.1+cpu、1.13.1+cu116、1.13.1+cu117、1.13.1+cu117.with.pypi.cudnn、1.13.1+rocm5.1.1、1.13.1+rocm5.2、2.0.0、2.0.0+cpu、2.0.0+cpu.cxx11.abi、2.0.0+cu117、2.0.0+cu117.with.pypi.cudnn、2.0.0+cu118、2.0.0+rocm5.3、2.0.0+rocm5.4.2、2.0.1、2.0.1+cpu、2.0.1+cpu.cxx11.abi、2.0.1+cu117、2.0.1+cu117.with.pypi.cudnn、2.0.1+cu118、2.0.1+rocm5.3、2.0.1+rocm5.4.2)
错误:找不到与torch==1.8.0+cu111匹配的分发版

我已验证我的环境中的CUDA版本为11.8。我有一块NVIDIA 1650Ti显卡。

有人可以帮助我理解为什么我无法在Colab环境中安装torch==1.8.0+cu111吗?是否有替代方案或解决方法可以安装具有CUDA支持的这个特定版本?感谢您提前的任何见解或建议!我尝试安装它,尝试以注释的形式显示在代码中。

英文:

I am trying to install PyTorch with CUDA support (torch==1.8.0+cu111) in a Colab notebook. However, I'm encountering an error during the installation process. Here is the code snippet that triggers the error:

import subprocess

CUDA_version = 
展开收缩
).decode("UTF-8").split(", ") if s.startswith("release")][0].split(" ")[-1] print("CUDA version:", CUDA_version) if CUDA_version == "10.1": torch_version_suffix = "+cu101" elif CUDA_version == "10.2": torch_version_suffix = "+cu102" else: torch_version_suffix = "+cu111" # pip install torch==1.7.0 -f https://download.pytorch.org/whl/torch_stable.html !pip install torch==1.8.0{torch_version_suffix} torchvision==0.9.0{torch_version_suffix} -f https://download.pytorch.org/whl/torch_stable.html ftfy reg

gives me the following error:

 Could not find a version that satisfies the requirement torch==1.8.0+cu111 (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu102, 1.11.0+cu113, 1.11.0+cu115, 1.11.0+rocm4.3.1, 1.11.0+rocm4.5.2, 1.12.0, 1.12.0+cpu, 1.12.0+cu102, 1.12.0+cu113, 1.12.0+cu116, 1.12.0+rocm5.0, 1.12.0+rocm5.1.1, 1.12.1, 1.12.1+cpu, 1.12.1+cu102, 1.12.1+cu113, 1.12.1+cu116, 1.12.1+rocm5.0, 1.12.1+rocm5.1.1, 1.13.0, 1.13.0+cpu, 1.13.0+cu116, 1.13.0+cu117, 1.13.0+cu117.with.pypi.cudnn, 1.13.0+rocm5.1.1, 1.13.0+rocm5.2, 1.13.1, 1.13.1+cpu, 1.13.1+cu116, 1.13.1+cu117, 1.13.1+cu117.with.pypi.cudnn, 1.13.1+rocm5.1.1, 1.13.1+rocm5.2, 2.0.0, 2.0.0+cpu, 2.0.0+cpu.cxx11.abi, 2.0.0+cu117, 2.0.0+cu117.with.pypi.cudnn, 2.0.0+cu118, 2.0.0+rocm5.3, 2.0.0+rocm5.4.2, 2.0.1, 2.0.1+cpu, 2.0.1+cpu.cxx11.abi, 2.0.1+cu117, 2.0.1+cu117.with.pypi.cudnn, 2.0.1+cu118, 2.0.1+rocm5.3, 2.0.1+rocm5.4.2)
ERROR: No matching distribution found for torch==1.8.0+cu111

I have verified that the CUDA version in my environment is 11.8.
I have a Nvedia 1650Ti Graphic card

Can someone please help me understand why I'm unable to install torch==1.8.0+cu111 in my Colab environment? Is there an alternative or workaround I can use to install this specific version with CUDA support?
I appreciate any insights or suggestions. Thank you in advance!

I tried to install it and the attempts are displayed in the codes in the form of comments

答案1

得分: 1

Your installation command appears to have some weird filler stuff, like {torch_version_suffix}, and at the end it says ftfy reg. Who is Reg, and what did someone fix for them?

你的安装命令似乎有一些奇怪的填充内容,如{torch_version_suffix},并且最后提到了ftfy reg。Reg 是谁,有人为他们修复了什么?

You could try this:

你可以尝试使用以下命令:

pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html

(from here)

(来源于这里

英文:

Your installation command appears to have some weird filler stuff, like {torch_version_suffix}, and at the end it says ftfy reg. Who is Reg, and what did someone fix for them?

You could try this:

pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html

(from here)

huangapple
  • 本文由 发表于 2023年5月10日 16:50:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76216532.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定