question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to log hparams to Tensorboard?

See original GitHub issue

Hello! I’m trying to view my hparams on tensorboard, but can’t actually see them there. As I understood from documentation, to log hparams one should add self.hparams in the init of the LightningModule. Here’s what I’m doing:

class MyModule(pl.LightningModule):
    def __init__(self,hparams):
        super().__init__()
        self.hparams =  Namespace(**{'learning_rate': hparams.learning_rate,
                                    'batch_size':hparams.batch_size,
                                    'normalize_embeddings':hparams.normalize_embeddings,
                                    'normalize': hparams.normalize,
                                    'k_neighbors':hparams.k_neighbors,
                                    'melspec_dir':hparams.melspec_dir})

My hparams also contain Trainer hparams, so to log only the right ones, I wrote this workaround. But anyway, I could not see any of my hparams. What could be the problem?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

27reactions
RafailFridmancommented, Mar 30, 2020

Ok, I did it. It looks like that TensorBoard won’t display hparams if some previous runs were without them. So I had to start a new tb process with a clean logs directory. Everything works normal now.

0reactions
Bordacommented, Dec 15, 2020

Excuse me, could you please mention this behaviour in the docs? Thank you

That sounds as a good idea, mind send a PR with suggestion?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to log hparams to Tensorboard? · Issue #1225
Hello! I'm trying to view my hparams on tensorboard, but can't actually see them there. As I understood from documentation, to log hparams...
Read more >
Hyperparameter Tuning with the HParams Dashboard
Adapt TensorFlow runs to log hyperparameters and metrics; Start runs and log them all under one parent directory; Visualize the results in ...
Read more >
View Hparam in log - implementation help - Lightning AI
View Hparam in log ... You shall be able to see all hyper params in your TensorBoard if you have saved them in...
Read more >
HParams in Tensorboard, Run IDs and naming
I'm using SummaryWriter.add_hparams(params, values) to log hyperparameters during training of my Seq2Seq ...
Read more >
Hparam tensorboard logging with pytorch?
What is the problem? I'm trying to use some very simple code to get rolling with Tune and Pytorch Lightning. I've been... bug...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found