0
点赞
收藏
分享

微信扫一扫

pytorch1.7.1的安装环境配置

胡桑_b06e 2022-04-05 阅读 52
深度学习

安装torch

 - `pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html`

安装cuda

下载cuda11.0和cudnn8.0.5.39。
参考

测试代码

import torch
flag = torch.cuda.is_available()
print(flag)

ngpu= 1
# Decide which device we want to run on
device = torch.device("cuda:0" if (torch.cuda.is_available() and ngpu > 0) else "cpu")
print(device)
print(torch.cuda.get_device_name(0))
print(torch.rand(3,3).cuda()) 

举报

相关推荐

PyTorch环境配置及安装

pytorch的环境配置

pytorch环境配置

Pytorch环境配置

安装pytorch环境

0 条评论