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
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).
I was able to use the conda package manager to install keras and keras-gpu, with a compatible tensorflow and cuda versions to get past your TypeError: softmax()
... error message when I was trying to load the original BERT tensorflow checkpoint using the keras-bert package:
$ conda create -n bert python=3.6
$ conda activate bert
$ conda install keras==2.0.8
$ conda install keras-gpu==2.0.8
$ pip install keras-pos-embd==0.10.0
$ pip install keras-transformer==0.22.0
Keras - Tensorflow version's compatibility is problem that i have faced many times. I have used in the past (kept in bookmarks), this link, with matches of tensorflow
and keras
versions. I believe that keras 2.0.8
is compatible with tensorflow 1.4
There does not seem to be proper documentation on which Keras version targets which TensorFlow version. The quickest way to solve your problem may be just downgrading Keras one version at a time until you find one that works (or, conversely, upgrading one version at a time from one that you know to work until it breaks). If you find that tedious you can do it as a binary search.
Looking at the releases page, it seems that version 2.0.8 should be compatible with TensorFlow 1.4; it's about a year old already but at least you have an starting point there.