'keras vs. tensorflow.keras

Inspired by this post.

Why is there a difference between the 2 modules?

When would I use one over the other?

Anything else I should know?



Solution 1:[1]

Keras is a standalone high-level API that supports TensorFlow, Theano and CNTK backends. Now, Theano and CNTK are out of development.

tf.keras is the Keras API integrated into TensorFlow 2.

So, if you aim to use TensorFlow as your deep learning framework I recommend using tensorflow.keras for less headache.

Also based on a tweet from François Chollet, the creator of Keras:

We recommend you switch your Keras code to tf.keras.

Both Theano and CNTK are out of development. Meanwhile, as Keras backends, they represent less than 4% of Keras usage. The other 96% of users (of which more than half are already on tf.keras) are better served with tf.keras.

Keras development will focus on tf.keras going forward.

Importantly, we will seek to start developing tf.keras in its own standalone GitHub repository at keras-team/keras in order to make it much easier for 3rd party folks to contribute.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kaveh