Rawnak Yazdani
Rawnak Yazdani

Reputation: 1411

What is the difference between tensorflow.keras.layers and keras.layers?

I have read a related question's answer about this on stackoverflow which explains the difference between tensorflow.keras.layers and tensorflow.layers, link:

What is the difference between tf.keras.layers versus tf.layers?

But, it doesn't answer the difference between tensorflow.keras.layers and keras.layers, whereas I noticed I can import them also.

So, what is the difference between them?

Upvotes: 0

Views: 403

Answers (1)

Lescurel
Lescurel

Reputation: 11631

Keras used to be able to support different backends (tensorflow, theano and CNTK). Since keras 2.3, there is no difference between keras and tf.keras.

An excerpt from the Readme of the keras repository on github :

Multi-backend Keras and tf.keras

Multi-backend Keras has been discontinued. At this time, we recommend that Keras users who use multi-backend Keras with the TensorFlow backend switch to tf.keras in TensorFlow 2.0.

Keras 2.2.5 was the last release of Keras implementing the 2.2.* API. It was the last release to only support TensorFlow 1 (as well as Theano and CNTK).

The current release is Keras 2.4.0, which simply redirects to tf.keras.

Upvotes: 1

Related Questions