What is the difference between keras and tf.keras?

The difference between tf.keras and keras is the Tensorflow specific enhancement to the framework.

keras is an API specification that describes how a Deep Learning framework should implement certain part, related to the model definition and training.
Is framework agnostic and supports different backends (Theano, Tensorflow, …)

tf.keras is the Tensorflow specific implementation of the Keras API specification. It adds the framework the support for many Tensorflow specific features like: perfect support for tf.data.Dataset as input objects, support for eager execution, …

In Tensorflow 2.0 tf.keras will be the default and I highly recommend to start working using tf.keras

Leave a Comment