Error installing torch==1.8.0+cu111 in Colab.

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

Error installing torch==1.8.0+cu111 in Colab

问题

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

  1. import subprocess
  2. CUDA_version =
    展开收缩
    ).decode("UTF-8").split(", ") if s.startswith("release")][0].split(" ")[-1]
  3. print("CUDA版本:", CUDA_version)
  4. if CUDA_version == "10.1":
  5. torch_version_suffix = "+cu101"
  6. elif CUDA_version == "10.2":
  7. torch_version_suffix = "+cu102"
  8. else:
  9. torch_version_suffix = "+cu111"
  10. # pip install torch==1.7.0 -f https://download.pytorch.org/whl/torch_stable.html
  11. !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

给了我以下错误:

  1. 找不到满足要求torch==1.8.0+cu111的版本(从版本中找到:1.11.01.11.0+cpu1.11.0+cu1021.11.0+cu1131.11.0+cu1151.11.0+rocm4.3.11.11.0+rocm4.5.21.12.01.12.0+cpu1.12.0+cu1021.12.0+cu1131.12.0+cu1161.12.0+rocm5.01.12.0+rocm5.1.11.12.11.12.1+cpu1.12.1+cu1021.12.1+cu1131.12.1+cu1161.12.1+rocm5.01.12.1+rocm5.1.11.13.01.13.0+cpu1.13.0+cu1161.13.0+cu1171.13.0+cu117.with.pypi.cudnn1.13.0+rocm5.1.11.13.0+rocm5.21.13.11.13.1+cpu1.13.1+cu1161.13.1+cu1171.13.1+cu117.with.pypi.cudnn1.13.1+rocm5.1.11.13.1+rocm5.22.0.02.0.0+cpu2.0.0+cpu.cxx11.abi2.0.0+cu1172.0.0+cu117.with.pypi.cudnn2.0.0+cu1182.0.0+rocm5.32.0.0+rocm5.4.22.0.12.0.1+cpu2.0.1+cpu.cxx11.abi2.0.1+cu1172.0.1+cu117.with.pypi.cudnn2.0.1+cu1182.0.1+rocm5.32.0.1+rocm5.4.2
  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:

  1. import subprocess
  2. CUDA_version =
    展开收缩
    ).decode("UTF-8").split(", ") if s.startswith("release")][0].split(" ")[-1]
  3. print("CUDA version:", CUDA_version)
  4. if CUDA_version == "10.1":
  5. torch_version_suffix = "+cu101"
  6. elif CUDA_version == "10.2":
  7. torch_version_suffix = "+cu102"
  8. else:
  9. torch_version_suffix = "+cu111"
  10. # pip install torch==1.7.0 -f https://download.pytorch.org/whl/torch_stable.html
  11. !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:

  1. 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)
  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:

确定