PyTorch学习笔记

wang910930 2020-02-13 04:10:13
PyTorch
# 安装NVIDIA cuda
https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10

# GPU compute capability <= 3.5 无法使用1.3版本及以上的PyTorch
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0


# 清华镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes

# 下载
conda install pytorch torchvision cudatoolkit=10.1

# 检验运行成功
import torch
import torchvision
a = torch.Tensor(5, 3)
a = a.cuda()
print(a)

# 常用包调用
import torch
import torch.nn.functional as F
import torch.utils.data
from torchvision import datasets, transforms
import torch.optim as optim
import torch.nn as nn
...全文
25 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

353

社区成员

发帖
与我相关
我的任务
社区描述
CUDA高性能计算讨论
社区管理员
  • CUDA高性能计算讨论社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧