반응형

안녕하세요. 

 

만약 여기까지 따라 오셨다면 90% 정도 성공입니다. 나머지 10%는 Pytorch만 설치하면 됩니다. 굉장히 간단합니다. 

 

아래 Pytorch 공식 사이트를 들어 갑니다. 

https://pytorch.org/

 

PyTorch

An open source machine learning framework that accelerates the path from research prototyping to production deployment.

pytorch.org

아래로 쭉 내리시면,

위 사진처럼 있습니다. 

 

그런데 Run this Command를 그대로 복붙해서 설치하면 됩니다. 

 

Pytorch : 1.9

OS : Window10

Package : Anaconda

Language : Python

Compute Platform : CUDA 10.2

 

왜 CUDA 최신 버전을 사용하지 않고, CUDA 10.2로 사용하는지 의문이 들 수 있습니다. 

 

CUDA 11.1을 사용하기 위해서 CUDA TOOLKIT이 필요합니다. CUDA TOOLKIT을 설치하고 경로 설정하는 것이 굉장히 귀찮은 일이기 때문에, CUDA 10.2를 사용하면 TOOLKIT을 설치하지 않고 바로 사용할 수 있습니다.

import torch

# torch version
torch.__version__
#  1.9

#  Returns a bool indicating if CUDA is currently available.
torch.cuda.is_available()
#  True
 
#  Returns the index of a currently selected device.
torch.cuda.current_device()
#  0
 
#  Returns the number of GPUs available.
torch.cuda.device_count()
#  1
 
#  Gets the name of a device.
torch.cuda.get_device_name(0)
#  NVIDIA GeForce RTX 2060 SUPER
 
#  Context-manager that changes the selected device.
#  device (torch.device or int) – device index to select. 
torch.cuda.device(0)

 

 

Pytorch GPU가 준비 되었으니, 전에 만들어 둔 Se-ResNet을 이용하여 CIFAR-10 데이터 셋을 분류했습니다.

간단히 epoch 200번 정도 돌려 봤는데 괜찮은 결과가 나온 것 같습니다. 

 

이제 야외에서도 딥러닝을 돌려야할 때, 바로 사용할 수 있습니다. ( 해커톤 같은 경우 ...? )

 

https://coding-yoon.tistory.com/152

 

주피터 노트북 개인 딥러닝 서버 만들기 ! (1) with Window10, Pytorch

이번에 컴퓨터를 맞추면서 그래픽카드 RTX 2060 super를 구매했습니다. 저만의 딥러닝 서버를 만들어 놓으면 어디서든 야외에서 노트북으로 가볍게 작업할 수 있습니다. ( 얼마나 작업을 할지 모르

coding-yoon.tistory.com

https://coding-yoon.tistory.com/153

 

주피터 노트북 개인 딥러닝 서버 만들기 ! (2) with Window10, Pytorch

안녕하세요. 주피터 노트북 개인 딥러닝 서버 만들기 2편입니다. 이번 글은 주피터 노트북을 좀 더 유용하고 보기 좋게 만들기 위한 편입니다. 굳이 안 하시고 넘어가셔도 무방합니다. ~ 1. 주피

coding-yoon.tistory.com

 

728x90
반응형

+ Recent posts