Pytorch 시작하기

튜토리얼

https://tutorials.pytorch.kr/beginner/basics/quickstart_tutorial.html

 

빠른 시작(Quickstart) — PyTorch Tutorials 1.9.0+cu102 documentation

Note Click here to download the full example code 파이토치(PyTorch) 기본 익히기 || 빠른 시작 || 텐서(Tensor) || Dataset과 Dataloader || 변형(Transform) || 신경망 모델 구성하기 || Autograd || 최적화(Optimization) || 모델 저

tutorials.pytorch.kr

 

연습

import torch
from torchvision import datasets, transforms
import matplotlib.pyplot as plt

if __name__ == '__main__':
  train_loader = torch.utils.data.DataLoader(
    datasets.MNIST('./data/', train=True, download=True, transform=transforms.Compose([transforms.ToTensor()])),
    batch_size=32)

  test_loader = torch.utils.data.DataLoader(
    datasets.MNIST('./data/', train=False, download=True, transform=transforms.Compose([transforms.ToTensor()])),
    batch_size=32)

  i = 1
  for X, y in test_loader:
    print(i)
    i += 1
    print('Shape of X: ', X.shape, X.dtype)
    print('Shape of y: ', y.shape, y.dtype)

  train_image, train_label = next(iter(train_loader))
  plt.imshow(train_image[0][0], 'gray')
  plt.show()

  test_image, test_label = next(iter(train_loader))
  plt.imshow(test_image[0][0], 'gray')
  plt.show()

 

시작할 만한 예제

https://openaccess.thecvf.com/content_WACV_2020/papers/Zhang_Deep_Image_Blending_WACV_2020_paper.pdf

https://github.com/owenzlz/DeepImageBlending

 

GitHub - owenzlz/DeepImageBlending: This is a Pytorch implementation of deep image blending

This is a Pytorch implementation of deep image blending - GitHub - owenzlz/DeepImageBlending: This is a Pytorch implementation of deep image blending

github.com

 

'Machine Running > Pytorch' 카테고리의 다른 글

Ubuntu 18.04 Pytorch 설치 및 실행  (0) 2021.09.30