Recent Posts
«   2025/09   »
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
Today
Total
관리 메뉴

코드민수

[Python] Tensorflow & Pytorch GPU 사용 확인 본문

[Python]/코드

[Python] Tensorflow & Pytorch GPU 사용 확인

코드민수 2023. 4. 7. 15:14
BIG

tensorflow에서 GPU 사용 가능 여부 확인

from tensorflow.python.client import device_lib
device_lib.list_local_devices()

 

Pytorch에서 GPU 사용 가능 여부 확인

import torch
print(torch.cuda.is_available())

 

CUDA, cudnn, tensorflow, pytorch가 버전에 맞게 잘 설치되어 있어야 작동합니다.

LIST