Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can Tensorboard files be merged/combined or appended?

If I have multiple Tensorboard files, how can they be combined into a single Tensorboard file?

Say in keras the following model.fit() was called multiple times for a single model, for example in a typical GAN implementation:

for i in range(num_epochs):
    model.fit(epochs=1, callbacks=Tensorboard())

This will produce a new Tensorboard file each time, which is not useful. Not sure if there is way to have Tensorboard append, or not produce unique time-stamped files each callback call.

like image 359
mikal94305 Avatar asked Aug 13 '17 06:08

mikal94305


1 Answers

It seems in tensorboard 2.3, you can access the tensorboard file's logged data and load it into a pandas dataframe. This tutorial outlines the approach:

https://www.tensorflow.org/tensorboard/dataframe_api

At the time of writing, I couldn't find a tensorboard version 2.3, but the module the tutorial relies upon - tensorboard.data.experimental.ExperimentFromDev() - seems to be present in tensorboard 2.2: https://github.com/tensorflow/tensorboard/blob/master/tensorboard/data/experimental/experiment_from_dev.py#L71

You could load existing data from several tensorboard files into dataframes and then combine those dataframes in the desired manner to write the combined dataframe to a new tensorboard file. I had considered this approach to address the problem of having multiple tensorboard files for different training runs but haven't tried it yet in my project.

like image 96
dzubke Avatar answered Nov 13 '22 00:11

dzubke