TensorBoard logs visualization are without a name

Viewed 148

enter image description here

I run several models and here are visualized my results. However, there is no way to have a more meaningful name for the models (highlighted in yellow). Do you know:

  1. a way to rename them in the model (maybe there is a property to set equal to something)
  2. a way to get from the model the corresponding code visualized here at least

Otherwise, the only way to know the correspondence is to manually check for the logs from the fitting phase.

1 Answers

The name is dependent on the directory where you save your logs. If you save your log to "./logs/<MODEL_NAME>/train", <MODEL_NAME> would appear at tensorboard.

I usually define a modelname including a timestamp. In that way, the name is changed with every run. It could look s.th. like this:

import time
import os
import tensorflow as tf

modelName = f"My_model_{int(time.time())}"

with tf.summary.create_file_writer(os.path.join("logs",modelName,"train")):
  tf.summary.scalar("epoch_loss", data=epoch_loss, step=epoch, description="loss at every epoch")

I considered your loss value you want to log at step=epoch is stored in the variable epoch_loss.

Related