pytorch的cuda版本安装
机器上加了RTX3060的卡,cuda装的11.1的版本,cudnn还不是特别清楚装的哪个版本?vs是2017这个版本的。下面来装pytorch。主要参考这个网站的内容“https://blog.csdn.net/weixin_43760844/article/details/115612970”。
在anaconda里输入这几行代码
import torch
import tensorflow as tf
print(torch.version)
print(torch.cuda.is_available())
print(torch.zeros(1).cuda())
print(tf.test.is_built_with_cuda())
print(tf.test.is_gpu_available())
提示我的显卡功能并没有使上。还是cpu版本的。从网站“https://download.pytorch.org/whl/torch_stable.html”去下载轮子文件,下了下面几个:
torch-1.9.1+cu111-cp36-cp36m-win_amd64.whl
torch-1.10.1+cu111-cp36-cp36m-win_amd64.whl
在anacoanda的terminal里pip install .\torch-1.10.1+cu111-cp36-cp36m-win_amd64.whl --user报下面的错误信息:
torchvision 0.11.3 requires torch==1.10.2, but you have torch 1.10.1+cu111 which is incompatible.
根据报错信息,从新下载了
torch-1.10.2+cu111-cp36-cp36m-win_amd64.whl
然后从新在terminal输入命令:pip install .\torch-1.10.2+cu111-cp36-cp36m-win_amd64.whl --user
这下虽然有很多黄色warning错误提示,但总算是安装成了。重启测试:
import torch
print(torch.backends.cudnn.version())
print(torch.version)
print(torch.version.cuda)
print(torch.zeros(1).cuda())
print(torch.cuda.is_available())
输出:
8005
1.10.2+cu111
11.1
tensor([0.], device='cuda:0')
True
这算是安装成功了吧。后续用用就知道了。
最新文章
- 安装maven编译环境
- MyEclipse 优化
- 欢迎进入Node.js世界
- Office启动加载vs。。。项
- tcp 的6个控制位
- javascript中slice() splice() concat()操作数组的方法
- Docker常见仓库MongoDB
- Golang基础语法1
- Ubuntu 16.04 安装Mysql数据库
- java学习笔记(八):继承、extends、super、this、final关键字
- <; meta http-equiv = ";X-UA-Compatible"; content = ";IE=edge,chrome=1"; />;的意义
- role=";navigation";
- js异步请求方式
- C# int.ToString()
- MongoDB安装成为Windows服务及日常使用遇到问题总结
- c实现windows socket
- Cannot read property ‘msie’ of undefined错误原因以及解决方案
- R语言中字符串的拼接操作
- 二、python小功能记录——监听鼠标事件
- BP神经网络研究(一)
热门文章
- 野火STM32 ADC独立模式单通道采集实验意外
- 使用伪元素 before 叹号
- VUE学习-条件渲染
- 【面试题】JS 中这些继承方式你知道吗?
- phpstudy 配置域名解决index.php 过多重定向
- 数据库链接失败错误ERROR com.alibaba.druid.pool.DruidDataSource - {dataSource-1} init error解决
- vscode plugin - jenkins jack使用方法
- vue去除富文本的标签和样式
- QT控件使用--QPlainTextEdit
- BLOG-2