windows10安装pytorch错误记录

和上一篇Linux安装一样,清华源总是会出很多问题,pip安装也比conda好用

1.正常安装

参考文章:https://blog.csdn.net/zxdmy/article/details/114072995

1.1 安装cuda

首先进入Pytoch安装官网:https://pytorch.org/,选择cuda版本
在这里插入图片描述
进入cuda安装官网:https://developer.nvidia.com/cuda-toolkit-archive,安装cuda11.3
按照安装提示默认安装即可。

安装完成后,可以打开文件夹 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA,可以看到当前目录已经存在v10.1文件夹,表示已经成功安装cuda10.1版本,并且上述安装程序已经自动的向环境变量中添加了对应的cuda路径,使得后续pytorch可以正常调用和执行。

最后,测试一下cuda是否安装成功。

nvcc -V

C:\Users\xiaochen>nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Mar_21_19:24:09_Pacific_Daylight_Time_2021
Cuda compilation tools, release 11.3, V11.3.58
Build cuda_11.3.r11.3/compiler.29745058_0

1.2 安装cudnn

cudnn官网下载地址:https://developer.nvidia.com/cudnn
在这里插入图片描述

1.3 安装Pytoch

conda install pytorch torchvision torchaudio cudatoolkit=11.3

2出现错误与解决记录

2.1 An HTTP error occurred when trying to retrieve this URL.

科大源不能用,换成了清华源
另外还更新了conda

2.2 Permission denied

用管理员身份打开ananconda prompt

2.3 PackagesNotFoundError: The following packages are not available from current channels:

参考:https://blog.csdn.net/weixin_45552562/article/details/109668589
在 https://anaconda.org中直接下载我要的包
在这里插入图片描述
把下载好安装包放到D/anaconda3/pkgs/里,然后执行命令:

  conda install --use-local  安装包.tar.bz2

2.4 torch.cuda.is_available()=False

安装结束后,测试安装结果

import torch 

print(torch.__version__)
print(torch.cuda.is_available())

1.12.0
False

参考:https://blog.csdn.net/Andy_Luke/article/details/122503884
用pip下载

pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu113

下载成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值