tf.keras.backend.clear_session

tf.keras.backend.clear_session()

Defined in tensorflow/python/keras/_impl/keras/backend.py.

Destroys the current TF graph and creates a new one.

Useful to avoid clutter from old models / layers.