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

您所在的位置:网站首页 tensorflow1140跟cuda哪个版本对应 cuda、torch、torchvision对应版本以及安装

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

2023-11-18 17:59| 来源: 网络整理| 查看: 265

查找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/

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.1cp38:表示适用python版本为3.8linux:表示适用于linux系统x86_64:表示同时兼容32和64位系统

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

测试

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

python import torch print(torch.__version__)

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

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

在这里插入图片描述



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3