Keras on GPU on windows with python 3.7.13

Issue

I had to reinstall completely my python distribution lately and for some reasons I cannot run keras on GPU anymore.

I followed the instructions from Can I run Keras model on gpu? but for some reason, I do not see my GPU when trying to list the devices.

my versions are :

  • tensorflow & tensorflow-gpu : 2.3.0
  • keras : 2.3.1
  • cudatoolkit : 11.3.1

I have not installed cudnn yet as the instructions are a bit blurry for me : do I have to install it in the cudatoolkit directory ? Is it required to run on GPU ?

Thanks

Solution

OK so here is the solution :

Python 3.7.13 requires tensorflow-gpu 2.1.0 to detect gpu.
So the correct set of versions is :

  • Python 3.7.13
  • tensorflow 2.1.0
  • keras 2.3.0
  • cudnn 7.6.5
  • cudatoolkit 10.1.243

with this it works. Be careful that for some reason, in my case tensorflow downloaded tensorflow-estimator 2.6.0. I had to downgrade to 2.1.0 to get spyder running.

Answered By – johnnyp

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published