์๋ ํ์ธ์.
๋ง์ฝ ์ฌ๊ธฐ๊น์ง ๋ฐ๋ผ ์ค์ จ๋ค๋ฉด 90% ์ ๋ ์ฑ๊ณต์ ๋๋ค. ๋๋จธ์ง 10%๋ Pytorch๋ง ์ค์นํ๋ฉด ๋ฉ๋๋ค. ๊ต์ฅํ ๊ฐ๋จํฉ๋๋ค.
์๋ Pytorch ๊ณต์ ์ฌ์ดํธ๋ฅผ ๋ค์ด ๊ฐ๋๋ค.
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