tensorboard: Tensorboard metrics not loaded properly

I have the problem that in Tensorboard the metrics are not loaded correctly (the column is always empty), although the scalars are saved correctly. I am working with torch.utils.tensorboard.

tensorboard_metrics

Relevant code:

writer = SummaryWriter(log_dir=f'./logs/studies/{study_name}/')

In the training loop: writer.add_scalar(tag='validation/min_loss', scalar_value=min_val_loss, global_step=trial.number)

Add the hyperparameter to the summary writer (args_dict is a dictionary with all hyperparameters) writer.add_hparams(hparam_dict=args_dict, metric_dict={'validation/min_loss': min_val_loss}, run_name=run_name) writer.close()

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (5 by maintainers)

Most upvoted comments

I am also experiencing this same issue. My environment is python 3.12 through miniconda on Windows 10 Pro 19045, with Tensorboard 2.19.0. Note that I do not have any issue when running Tensorboard from Debian 12, also with Tensorboard with 2.19.0. Even more surprising, mounting my windows directory into WSL Ubuntu 22 and running tensorboard from there also works.

At least in my case, this therefore seems to be a windows specific issue.

This seems to be an issue with purely visualization, not logging, because I can log the data with Windows python and visualize without issue through WSL when mounting the Windows-generated tensorboard logs. This behavior was tested with both tensorflow logging and pytorch torch.utils.tensorboard logging.

@timr1101 @lebeand @kevinunger @dlindmark @0523ronli @XuRainbow Can you confirm if you were using Windows when encountering the issue?

I’m also having the same issue with tensorboard==2.18.0 and tensorboard-data-server==0.7.2.

I still experience this on TB 2.19.0 I write my data like this.

from torch.utils.tensorboard import SummaryWriter
w = SummaryWriter("hparams/results")
w.add_hparams(
    {"lr": 1e-3, "batch_size": 4096},
    {"episode_return_mean": 123.4}
)
w.close()

using torch==2.8.0 and TB==2.19.0 i do not get any values in my episode_return_mean column in the hparams tab of tensorboard. Downgrading TB to 2.16.2 fixes it. But then I must downgrade protobuf aswell. Which I cannot do due to other dependencies.

I have the same issue in tensorboard==2.19.0 Is anyone working on the fix?

Hey James, the tensorboard versions were indeed the deciding factor. I had the newer versions

tensorboard 2.17.1 tensorboard-data-server 0.7.2

installed. Downgrading to

tensorboard 2.8.0 tensorboard-data-server 0.6.1

solved the problem and all metrics were displayed correctly. Thank you very much for your help! One more note: I also installed the today released version

tensorboard 2.18.0

and

tensorboard-data-server 0.7.2

However, the problem still exists for these.

Hey Tim, thanks for sending me your logs. Unfortunately, I still cannot reproduce the issue. I ran these commands:

pip install --upgrade pip pip install tensorboard tensorboard --logdir ./your/log/dir

Screenshot 2024-09-25 at 11 47 30 AM

What version of TensorBoard are you running?

pip freeze | grep tensorboard tensorboard==2.8.0 tensorboard-data-server==0.6.1

Sure. But since I’m currently on vacation, I can’t do this until the beginning of next week.