Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.2 doesn't log hyper parameters #4186

Closed
xiadingZ opened this issue Oct 16, 2020 · 3 comments · Fixed by #4189
Closed

1.0.2 doesn't log hyper parameters #4186

xiadingZ opened this issue Oct 16, 2020 · 3 comments · Fixed by #4189
Labels
duplicate This issue or pull request already exists help wanted Open to be worked on question Further information is requested

Comments

@xiadingZ
Copy link

xiadingZ commented Oct 16, 2020

In pt 1.0.2, tensorboard can't log hyperparameters, it only show hp_metrics. and hparams.yaml is empty

this is my code aboud hparams:

class Video_Base(pl.LightningModule):
    def __init__(self, hparams, *args, **kwargs):
        super().__init__()
        self.hparams = hparams
        ...
@xiadingZ xiadingZ added bug Something isn't working help wanted Open to be worked on labels Oct 16, 2020
@xiadingZ xiadingZ changed the title 1.0.2 tensorboard doesn't log hparameters 1.0.2 doesn't log hyper parameters Oct 16, 2020
@ndrplz
Copy link

ndrplz commented Oct 16, 2020

I think you should replace

self.hparams = hparams

with

self.save_hyperparameters()

(see here)

related: #4179

@Borda Borda added duplicate This issue or pull request already exists question Further information is requested and removed bug Something isn't working labels Oct 16, 2020
@Borda
Copy link
Member

Borda commented Oct 16, 2020

well we are saving the initial arguments, so you should be calling self.save_hyperparameters()
this is not just the case of TB, it is for all loggers since #4163

the reccomended flow is:

class MyModule(pl.LightningModule):
    def __init__(self, arg1, arg2):
        super().__init__()
        self.save_hyperparameters()
        ...

@Borda Borda closed this as completed Oct 16, 2020
@Borda
Copy link
Member

Borda commented Oct 16, 2020

eventually, we may permit this action if self.hparams = hparams is inside __init__ or just for the fist time is called...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists help wanted Open to be worked on question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants