I am having an error regarding (Keras that does not support TensorFlow 2.0. We recommend using tf.keras
, or alternatively, downgrading to TensorFlow 1.14.) any recommendations.
thanks
import keras
#For building the Neural Network layer by layer
from keras.models import Sequential
#To randomly initialize the weights to small numbers close to 0(But not 0)
from keras.layers import Dense
classifier=tf.keras.Sequential()
classifier.add(Dense(output_dim = 6, init = 'uniform', activation = 'relu', input_dim = 11))
RuntimeError: It looks like you are trying to use a version of multi-backend Keras that does not support TensorFlow 2.0. We recommend using `tf.keras`, or alternatively, downgrading to TensorFlow 1.14.
this line of code on the first cell worked for me
%tensorflow_version 1.x
TensorFlow 2.0+ is only compatible with Keras 2.3.0+, so if you wish to use Keras 2.2.5-, you'll need TensorFlow 1.15.0-. Alternatively, yes, you can do
from tensorflow.keras import ...
, but that will not use yourkeras
package at all and you might as well uninstall it.if you want to use
tensorflow 2.0+
you must havekeras 2.3+
try to upgrade your keras it works for me :
or you may specify the keras version to 2.3
first, import tensorflow:
Next, in place of this,
use:
Let me know if it works.
You should only have to change the imports at the top:
I ran into the same issue. Downgraded my TensorFlow to version 1.14 using the following:
Fixed the error.