解决 ERROR: Could not find a version that satisfies the requirement torch==1.10.0+cu102

这篇具有很好参考价值的文章主要介绍了解决 ERROR: Could not find a version that satisfies the requirement torch==1.10.0+cu102。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

前提

笔者的问题不是网络问题
python版本:3.10
本机CUDA版本:10.2
OS:Windows10

问题

下载torch时报错:

pip install torch==1.10.0+cu102 torchvision==0.11.0+cu102 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html
Looking in indexes: https://mirrors.cloud.tencent.com/pypi/simple
Looking in links: https://download.pytorch.org/whl/torch_stable.html

ERROR: Could not find a version that satisfies the requirement torch==1.10.0+cu102 (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu113, 1.11.0+cu115, 1.12.0, 1.12.0+cpu, 1.12.0+cu113, 1.12.0+cu116, 1.12.1, 1.12.1+cpu, 1.12.1+cu113, 1.12.1+cu116, 1.13.0, 1.13.0+cpu, 1.13.0+cu116, 1.13.0+cu117, 1.13.1, 1.13.1+cpu, 1.13.1+cu116, 1.13.1+cu117, 2.0.0, 2.0.0+cpu, 2.0.0+cu117, 2.0.0+cu118)
ERROR: No matching distribution found for torch==1.10.0+cu102

原因

python3.10目前在pytorch提供的库中根本没有对应的windows10环境的torch库

https://download.pytorch.org/whl/torch
注:cu代表CUDA版本,cp代表python版本

error: could not find a version that satisfies the requirement torch (from v,pytorch,深度学习,python

解决

安装python3.8,注意添加环境变量
error: could not find a version that satisfies the requirement torch (from v,pytorch,深度学习,python

然后以管理员身份打开cmd,执行安装指令


C:\Windows\system32>pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu102
Looking in indexes: https://download.pytorch.org/whl/cu102
Collecting torch
  Using cached https://download.pytorch.org/whl/cu102/torch-1.10.2%2Bcu102-cp38-cp38-win_amd64.whl (1486.0 MB)
Collecting torchvision
  Using cached https://download.pytorch.org/whl/cu102/torchvision-0.11.3%2Bcu102-cp38-cp38-win_amd64.whl (2.6 MB)
Collecting torchaudio
  Using cached https://download.pytorch.org/whl/cu102/torchaudio-0.10.2%2Bcu102-cp38-cp38-win_amd64.whl (336 kB)
Collecting typing-extensions
  Using cached https://download.pytorch.org/whl/typing_extensions-4.4.0-py3-none-any.whl (26 kB)
Collecting pillow!=8.3.0,>=5.3.0
  Using cached https://download.pytorch.org/whl/Pillow-9.3.0-cp38-cp38-win_amd64.whl (2.5 MB)
Collecting numpy
  Using cached https://download.pytorch.org/whl/numpy-1.24.1-cp38-cp38-win_amd64.whl (14.9 MB)
Installing collected packages: typing-extensions, torch, pillow, numpy, torchvision, torchaudio
Successfully installed numpy-1.24.1 pillow-9.3.0 torch-1.10.2+cu102 torchaudio-0.10.2+cu102 torchvision-0.11.3+cu102 typing-extensions-4.4.0

C:\Windows\system32>python
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
>>> torch.__version__
'1.10.2+cu102'

指令来源:https://pytorch.org/get-started/locally/
我这里直接将后缀改为自己的CUDA版本cu102就可以下载
error: could not find a version that satisfies the requirement torch (from v,pytorch,深度学习,python
当然也可以下载其他版本的torch:
https://pytorch.org/get-started/previous-versions
error: could not find a version that satisfies the requirement torch (from v,pytorch,深度学习,python文章来源地址https://www.toymoban.com/news/detail-785124.html

到了这里,关于解决 ERROR: Could not find a version that satisfies the requirement torch==1.10.0+cu102的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包