2024-여름

AssertionError: Torch not compiled with CUDA enabled

돌멩이수프 2024. 7. 29. 23:57
728x90

GPU와 Pytorch가 맞지 않아 생기는 오류로 내 GPU는 사용할 수 있는 종류였지만 에러가 사라지지 않았다.

https://developer.nvidia.com/cuda-gpus

 

CUDA GPUs - Compute Capability

Explore your GPU compute capability and CUDA-enabled products.

developer.nvidia.com

 

위 사이트에 들어간다. 자신이 사용하는 GPU 종류에 맞게 클릭해보면 지원 여부를 확인할 수 있다.

 

기존 torch를 삭제하고 재설치하는 코드다. 

pip uninstall torch
pip cache purge
pip install torch -f https://download.pytorch.org/whl/torch_stable.html

 또는

pip install torch===1.5.0 torchvision===0.6.0 -f https://download.pytorch.org/whl/torch_stable.html

 

처럼 torch를 다시 설치해주면 된다.

 

나는 안 된다...

728x90