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.
We recommend using tf.keras, or alternatively, downgrading to TensorFlow 1.14. Sorry, something went wrong. how to solve the below error in google colab... RuntimeError: It looks like you are trying to use a version of multi-backend Keras that does not support TensorFlow 2.0.
Therefore, if you are starting a new TFX project, we recommend that you use TensorFlow 2.x. You may want to update your code later as full support for Keras and other new features become available, and the scope of changes will be much more limited if you start with TensorFlow 2.x, rather than trying to upgrade from TensorFlow 1.x in the future.
The tf.keras submodule was introduced in TensorFlow v1.10.0, the first step in integrating Keras directly within the TensorFlow package itself. The tf.keras package is/was separate from the keras package you would install via pip (i.e., pip install keras ).
Keras v2.3.0 is the first release of Keras that brings keras in sync with tf.keras It will be the the last major release to support backends other than TensorFlow (i.e., Theano, CNTK, etc.) And most importantly, deep learning practitioners should start moving to TensorFlow 2.0 and the tf.keras package
You should only have to change the imports at the top:
from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras import Sequential
classifier = Sequential()
classifier.add(Dense(6, init = 'uniform', activation = 'relu', input_dim = 11))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With