简体   繁体   中英

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

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 ?

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM