Tensorboard in Colab: No dashboards are active for the current data set

Issue

I am trying to display a Tensorboard in Google Colab. I import tensorboard: %load_ext tensorboard, then create a log_dir, and fit it as follows:

log_dir = '/gdrive/My Drive/project/' + "logs/fit/" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=log_dir, histogram_freq=1)

history = model.fit_generator(
    train_generator,
    steps_per_epoch=nb_train_samples // batch_size,
    epochs=epochs,
    validation_data=validation_generator,
    validation_steps=nb_validation_samples // batch_size,
    callbacks=[tensorboard_callback])

But when I call it with %tensorboard --logdir logs/fit it doesn’t display. Instead, it throws the following message:

No dashboards are active for the current data set.

Is there a solution for this? is the problem in the fixed path I passed in log_dir?

Solution

Please try the below code

log_dir = '/gdrive/My Drive/project/' + "logs/fit/"
tensorboard_callback = tf.keras.callbacks.TensorBoard(log_dir=log_dir, histogram_freq=1)

history = model.fit_generator(
    train_generator,
    steps_per_epoch=nb_train_samples // batch_size,
    epochs=epochs,
    validation_data=validation_generator,
    validation_steps=nb_validation_samples // batch_size,
    callbacks=[tensorboard_callback])

    %load_ext tensorboard
    %tensorboard --logdir /gdrive/My Drive/project/logs/fit/

Answered By – bsquare

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published