LoginSignup
0
0

More than 1 year has passed since last update.

WindowsでTensorflowがGPUを認識しないとき

Posted at

前提

Windowsにて、pipで入れたtensorflowがGPUを認識してくれない。
CUDA、CUDNNはダウンロードしてpathを通してある状態。

原因

Windows Storeから入手したPythonでは、TensorflowがGPUを上手く認識してくれない模様。
[重要] しかもWindowsが勝手に設定したエイリアスで、pythonと打つとStore版を使うようにしてくるので、それをoffにする必要あり。

解決法

  1. 「アプリと機能」から「アプリ実行エイリアス」を開く。
    画像の真ん中です。
    image.png

  2. PythonとPython3がMicrosoft Store版のPythonに紐づけられているので、オフにする。
    画像の状態にしてください。
    image.png

  3. Python公式 (python.org) からTensorflowが対応しているPythonを入れる。
    Note: 記事執筆時ではTensorflow2.7はPython3.10をサポートしていないので、3.9を入れました。
    PythonはWindows embeddable package と Windows installerがありますが、理由がないならWindows installerにした方が良いです。
    image.png

最後に

感想や指摘などありましたら、是非コメントください。

0
0
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
0
0