7
5

pipでPyTorchインストール時に「Torch not compiled with CUDA enabled」エラー

Posted at

Windows11でGPU(CUDA)を認識しない時に AssertionError: Torch not compiled with CUDA enabled エラーが起きる。PyTochの中にCPUのみのバージョンが存在しているのが原因。

AssertionError: Torch not compiled with CUDA enabled

他の記事だとconda環境での解決方法しか載っていなかった。

解決方法

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

pip install torchで -f https://download.pytorch.org/whl/torch_stable.html 引数を指定してインストールし直す。ローカルに前のバージョンが残っている可能性があるため、二行目でキャッシュを削除している。

または公式ドキュメントを参考に、# CUDA ~の下を参考にバージョンを指定してインストールすることでも可能。

参考

7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5