栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

windows下 更新cuda,cudnn,torch

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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选

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后本地安装

成功

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/753334.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号