当前位置:   article > 正文

cuda、torch、torchvision对应版本以及安装_torchvision版本

torchvision版本

查找torch与torchvision对应版本

github链接:https://github.com/pytorch/vision#installation
在这里插入图片描述

在线下载或者离线下载

1、在线下载
pytorch官网选择相应的历史版本,使用conda或者pip安装,使用官网的镜像下载很慢,建议使用其他的镜像源,这里我使用的是阿里的镜像速度还不错。
在这里插入图片描述

pip install torch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 -i https://mirrors.aliyun.com/pypi/simple/
  • 1

2、离线下载
torch网站中选择cuda、torch、torchivsion、python的对应版本,想下载cpu版本的开头选cpu,向下载gpu版本的选cu开头的,注意一定要下载对应的版本,要不然会有很多错误!
CUDA11.3目录
在这里插入图片描述
cu102/torch-1.7.1-cp38-cp38-linux_x86_64.whl

  • cu102:表示cuda版本为10.2,
  • torch-1.7.1:表示torch版本为1.7.1
  • cp38:表示适用python版本为3.8
  • linux:表示适用于linux系统
  • x86_64:表示同时兼容32和64位系统

下载完成后激活进入环境,pip install 路径\文件名.whl 安装即可

测试

如果安装成功,在环境中pip list即可查看安装的torch、torchvision、torchaudio版本
在这里插入图片描述
或者可以执行以下命令查看torch的版本

python
import torch
print(torch.__version__)
  • 1
  • 2
  • 3

在这里插入图片描述
使用torch查看cuda、cudnn版本

import torch
print(torch.__version__)
print(torch.version.cuda)
print(torch.backends.cudnn.version())
  • 1
  • 2
  • 3
  • 4

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/人工智能uu/article/detail/975316
推荐阅读
相关标签
  

闽ICP备14008679号