win10安装Pytorch GPU

https://blog.youkuaiyun.com/weixin_41762173/article/details/104261249

按照这篇文章执行下面指令时一直各种包都下载失败,可尝试重复下载可能可以成功。无法下载成功采用本地离线安装。

conda install pytorch torchvision cudatoolkit=10.1

下载失败后会提示对应的包的链接,复制该链接到迅雷直接下载,如:

https://conda.anaconda.org/pytorch/win-64/pytorch-1.5.1-py3.8_cuda101_cudnn7_0.tar.bz2
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/cudatoolkit-10.1.243-h74a9793_0.conda
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/mkl-2020.0-166.conda

下载成功后将下载的包复制到..\anaconda3\pkgs中,另外打开该目录下的urls.txt,将安装包对应的下载链接复制到最后。

再次执行,

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

这里我用了-c pytorch,也是从清华源下载的。

 

注意,安装包必须为错误提示对应的链接下载的,我尝试过用其他源下载的包也不能安装,安装包名称一模一样也不行。

另外我用下面指令进行离线安装一直都没成功:

conda install --offline pytorch-1.5.1-py3.8_cuda101_cudnn7_0.tar.bz2
conda install -n pytoch-gpu --use-local pytorch-1.5.1-py3.8_cuda101_cudnn7_0.tar.bz2

安装过程中可能用到的一些指令。 

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes

conda update -n base -c defaults conda
conda create -n pytorch-gpu --clone root
conda create -n pytorch-gpu
conda activate pytorch-gpu
conda deactivate
conda remove --name pytorch-gpu --all
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值