[Python] PyTorch TensorBoard SummaryWriter giving empty metrics

Discussão em 'Python' iniciado por Stack, Dezembro 18, 2024.

  1. Stack

    Stack Membro Participativo

    I've been setting up tensorboard with PyTorch. Originally I was using lightning, and ran into an issue where I would log my hyperparameter, but the metrics in the HPARAMS tab would be empty. So, to pin point the issue I moved over to the simplest possible example and the issue is still happening

    from torch.utils.tensorboard import SummaryWriter
    writer = SummaryWriter(log_dir="tb_logs/test")
    writer.add_hparams({"a": 0, "b": 0}, {"hparam/test_accuracy": 0.5})
    writer.add_hparams({"a": 0, "b": 1}, {"hparam/test_accuracy": 0.6})
    writer.add_hparams({"a": 1, "b": 0}, {"hparam/test_accuracy": 0.61})
    writer.add_hparams({"a": 1, "b": 1}, {"hparam/test_accuracy": 0.4})
    writer.add_hparams({"a": 2.0, "b": 1.5}, {"hparam/test_accuracy": 0.7})


    Per the PyTorch docs I'd expect to this exact table in the HPARAMS tab, but when I go I am met with this instead (https://imgur.com/a/zb1yTPA)

    I am using

    lightning 2.4.0
    torch 2.4.0
    tensorboard 2.17.0

    Continue reading...

Compartilhe esta Página