5
2

More than 1 year has passed since last update.

コマンドラインからpytorchでgpuが使えるかどうか確認する

Posted at

コマンドラインからpytorchでgpuが使えるかどうか確認するには以下を実行すればOK

https://note.nkmk.me/python-pytorch-cuda-is-available-device-count

$ python -c "import torch; print(torch.cuda.is_available())"
False

deviceの数を数えるには以下を実行すればOK

$ python -c "import torch; print(torch.cuda.device_count())"

参考

5
2
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
5
2