2

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

johnnyp
  • 119
  • 9
  • Did you check for GPU compatibility with cuda sdk ? https://developer.nvidia.com/cuda-gpus. Also make sure your GPU's drivers are up to date – imM4TT Jul 01 '22 at 23:44
  • You need to have cuDNN installed. – Djinn Jul 02 '22 at 02:43
  • I installed cudNN also according to https://stackoverflow.com/questions/63240027/tensorflow-2-3-0-cuda-toolkit-version-10-1-does-not-use-gpu but it still does not work. Also my script formerly running with keras now return a tensorflow error. I think I might have a version nconstitency issue. Where can I find a version compatibility list ? – johnnyp Jul 03 '22 at 06:26

1 Answers1

1

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.

johnnyp
  • 119
  • 9