Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- windows forms
- C
- mysql
- 컨테이너
- ubuntu
- 프로그래머스
- 오류
- OpenCV
- C#
- 기타 연주
- pandas
- error
- Selenium
- 채보
- Docker
- JSON
- SSH
- YOLO
- paramiko
- 핑거스타일
- label
- Python
- pip
- C++
- VS Code
- Visual Studio
- Numpy
- Linux
- pytorch
- nvidia-smi
Archives
- Today
- Total
기계는 거짓말하지 않는다
PyTorch torch 버전, GPU 사용 유무, 이름 확인, device 설정 본문
import torch
# torch version, gpu 사용 여부, 이름 체크
print("torch version>>", torch.__version__)
print("GPU 사용 유무>>", torch.cuda.is_available())
print("GPU 이름>> ", torch.cuda.get_device_name(0))
'''
torch version>> 1.7.1+cu101
GPU 사용 유무>> True
GPU 이름>> GeForce GTX 1650
'''
# device 설정. GPU 사용 가능 여부에 따라 device 정보 저장
device = "cuda:0" if torch.cuda.is_available() else "cpu"
print(device)
# cuda:0
'AI' 카테고리의 다른 글
단층 퍼셉트론(Single-Layer Perceptron) AND, OR, NAND (0) | 2021.08.19 |
---|---|
Classification 성능평가 (0) | 2021.08.18 |
torchvision VOC dataset download 문제 (0) | 2021.08.15 |
Python Scikit Learn Iris 꽃 분석, Classification (0) | 2021.08.12 |
회귀 분석(Regression) (0) | 2021.08.09 |
Comments