当前位置:网站首页>【pytorch】torch1.8.1安装、查看torch版本、GPU是否可用
【pytorch】torch1.8.1安装、查看torch版本、GPU是否可用
2022-07-26 05:01:00 【zoetu】
在conda虚拟环境下安装torch==1.8.1+gpu版本。
本机环境
CUDA 11.1
python 3.7
安装torch1.8.1
使用在线安装即可,离线安装需要下载对应的torch、torchvision、torchaudia安装包有点麻烦。
1. 在官网找到对应cuda版本
2. 安装命令
pip install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
如果出现找不到版本,请使用pip3 install

查看版本
import torch
# 检测torch、cuda、cudnn版本
print(torch.__version__)
print(torch.version.cuda)
print(torch.backends.cudnn.version())
#是否可用gpu
flag = torch.cuda.is_available()
print(flag)

边栏推荐
- BigDecimal 的 4 个坑,你踩过几个?
- Switch to router technology: OSPF single zone configuration, OSPF multi zone and end zone
- There was an unexpected error (type=method not allowed, status=405)
- JVM第二讲:类加载机制
- 汉字风格迁移篇---通过生成对抗网络学习一对多程式化汉字的转换和生成
- New knowledge in big homework
- MODFLOW Flex、GMS、FEFLOW、HYDRUS实践应用
- How to connect tdengine through idea database management tool?
- 公交站间的距离 : 简单模拟题
- [enterprise micro procedure]
猜你喜欢

数据库启动报:ORA-29702: error occurred in Cluster Group Service

Excel VBA:实现自动下拉填充公式至最后一行

Database startup message: ora-29702: error occurred in cluster group service

Customer service relationship management based on SQL net enterprise messenger enterprise communications

未来大气污染变化模拟

地球系统模式(CESM)实践技术
![[cloud native | 17] four network modes of container](/img/06/01204436c27b69a5ae6fcb04642c2a.jpg)
[cloud native | 17] four network modes of container

Axi protocol (5): burst mechanism of Axi protocol

User defined type details

There was an unexpected error (type=Method Not Allowed, status=405).记录报错
随机推荐
[mathematical modeling] basic knowledge of MATLAB
常函数const的学习
What are the well-known to-do apps at home and abroad
Character function and string function (I)
clock_ gettime
MySQL基础学习
The elderly who claim alimony from other children after being supported by their widowed daughter-in-law should be supported
「游戏引擎 浅入浅出」4. 着色器
推荐12个免费查找文献的学术网站,建议点赞、收藏!
嵌入式分享合集20
Kubernetes 进阶训练营 调度器
"Game engine light in light out" 4. shader
地球系统模式(CESM)实践技术
【洛谷】P1383 高级打字机
推荐系统-机器学习
Seata两阶段提交AT详解
JVM第六讲:线上环境 FGC 频繁,如何解决?
9 best project set management tools
Principle of image nonlocal mean filtering
汉字风格迁移篇---通过生成对抗网络学习一对多程式化汉字的转换和生成