windows下 更新cuda,cudnn,torch

因为adamw优化器要求torch版本1.5.0以上,
而cuda10.0对应torch到1.4.0因此更新cuda,cudnn,torch
卸载cuda10.0

cuda选11.1
官网链接
https://developer.nvidia.com/cuda-11.1.1-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal
在这里插入图片描述减压安装目录不能一样
cudnn
对照cuda选d

cudnn: https://developer.nvidia.com/rdp/cudnn-archive
选 : https://developer.nvidia.com/compute/machine-learning/cudnn/secure/8.0.5/11.1_20201106/cudnn-11.1-windows-x64-v8.0.5.39.zip

将三个文件夹复制cuda内
在这里插入图片描述在这里插入图片描述

先看一下到现在是否正确

import torch
print(torch.__version__) # torch version
print(torch.version.cuda)  # cuda version
print(torch.backends.cudnn.version())  # cudnn version

在这里插入图片描述

输出的 10.0 cuda 的版本并不一定是 Pytorch 在实际系统上运行时使用的 cuda 版本,而是编译该 Pytorch release 版本时使用的 cuda 版本

Pytorch 在实际系统上运行时使用的 cuda 版本运行下面代码

import torch
import torch.utils
import torch.utils.cpp_extension
print(torch.utils.cpp_extension.CUDA_HOME)

在这里插入图片描述
位置正确

torch:
选个差不多的版本

# CUDA 11.1
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

在这里插入图片描述
但无奈网速太慢,pip又不能断点续传,因此采用离线下载法下载whl后本地安装
在这里插入图片描述
成功

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值