怎么下载torch-GPU版本——本人踩坑多次总结!!!

我是直接把对应的包直接下载下来,然后手工配环境!这样可以避免很多报错!!!

torch-GPU的下载地址:

https://download.pytorch.org/whl/torch_stable.html

https://download.pytorch.org/whl/torch/

这两个都可以!
 

使用方法:
①下载对的torch版本!!!

②下载对的CUDA版本!!!

③下载对的Python版本!!!

④下载对的操作系统!!!

这四个一个都不能错!!!一定要看仔细!!!

1.打开ana prompt
2.cd 到whl文件所在的文件夹路径之中
3.pip install + 对应的whl文件名  一定要加whl

一定要关翻墙!!!——不管翻墙装不上去!

也可以直接

pip install D:\torchgpuwhl\torch-1.5.1-cp37-cp37m-win_amd64.whl

一定要已经在自己的电脑里的(文件会比较大,推荐放到D盘里)

我还踩过这些坑!↓

cp表示的是对应环境的Python版本号,一旦没有对上会pip不上去
报错:ERROR: torch-1.5.1+cu101-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.

如果遇到了报错:
Collecting package metadata (current_repodata.json): failed。
An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get
You will need to adjust your conda configuration to proceed.
Use conda config --show channels to view your configuration’s current state,and use conda config --show-sources to view config file locations.
PackagesNotFoundError: The following packages are not available from current channels:


解决方案:
正确的解决方法:
先删除已经设定好滴默认镜像源,执行下面的命令后就恢复了原来的源
conda config --remove-key channels
重新添加清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
重新执行这条命令:
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值