Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keras version to use with tensorflow-gpu 1.4

I am using ubuntu 16, with python 3, tf-GPU with keras.

I downgraded to tf 1.4 due to cuda errors as explained here

But now I am getting this error

TypeError: softmax() got an unexpected keyword argument 'axis'

Seems that this is an API change in tensorflow and new keras is not suitable for the old tf.

I can't find what is the correct keras version to use with tf 1.4 gpu. What is the correct one?

like image 931
thebeancounter Avatar asked Aug 15 '18 09:08

thebeancounter


People also ask

Does TensorFlow 1.14 have keras?

19.09 Keras 2.2. 4 is not compatible with Tensorflow 1.14 due to multi-gpu · Issue #72799 · NixOS/nixpkgs · GitHub.

Which version of TensorFlow is compatible with keras?

Installation & compatibility To start using Keras, simply install TensorFlow 2. Keras/TensorFlow are compatible with: Python 3.7–3.10.

Can keras run on GPU?

keras models will transparently run on a single GPU with no code changes required.


2 Answers

Keras - Tensorflow versions compatibility is a frequent problem that i have faced many times myself. I am keeping in my bookmarks this compatibility table, with matches of tensorflow and keras versions. It would seem that keras 2.0.8 is compatible with tensorflow 1.4.

like image 176
Ioannis Nasios Avatar answered Sep 22 '22 17:09

Ioannis Nasios


If you are using keras exclusively with the tensorflow backend, I would recommend to use the keras implementation found in tf.keras rather than the keras module. That way, you won't scratch your head about possible incompatibilities or bugs (see also that question).

like image 37
P-Gn Avatar answered Sep 20 '22 17:09

P-Gn