Keras with TensorBoard - Jupyter Notebook

Trains is now ClearML

This documentation applies to the legacy Trains versions. For the latest documentation, see ClearML.

The Allegro_Trains_keras_TB_example.ipynb example demonstrates Trains in automatic logging of code running in Jupyter Notebook that uses Keras and TensorBoard. It trains a simple deep neural network on the Keras built-in MNIST dataset. It builds a sequential model using a categorical crossentropy loss objective function, specifies accuracy as the metric, and uses two callbacks: a TensorBoard callback and a model checkpoint callback. When the script runs, it creates an experiment named Keras with TensorBoard example which is associated with the Colab notebooks project.

Open in Google Colab

In the trains GitHub repository, this example includes a clickable icon to open the notebook in Google Colab.


The loss and accuracy metric scalar plots appear in the RESULTS > SCALARS, along with the resource utilization plots, which are titled :monitor: machine.



Histograms for layer density appear in RESULTS > PLOTS.



Trains automatically logs TensorFlow DEFINEs which appear in CONFIGURATIONS > HYPER PARAMETERS > TF_DEFINE.



Text printed to the console for training progress, as well as all other console output, appear in RESULTS > LOG.


Configuration objects

The configuration appears in CONFIGURATIONS > CONFIGURATION OBJECTS > General.