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

Access to Pytorch Lightning auto_lr_find functionality seems broken [BUG] #1403

Closed
solalatus opened this issue Nov 30, 2022 · 1 comment
Closed
Labels
bug Something isn't working triage Issue waiting for triaging

Comments

@solalatus
Copy link
Contributor

Describe the bug

When using Pytorch based models, Lightning's auto_lr_find functionality does not seem to be accessible.

To Reproduce
When initializing a Pytorch based model, eg.:

model_nhits = NHiTSModel(... pl_trainer_kwargs = {"auto_lr_find":True,...} ...)

The LR tuning feature described here does not seem to get executed.

By manual tries to execute the tuning procedure by:

lr_finder = model_nhits.model.trainer.tuner.lr_find(model_nhits.model, train_dataloaders=[model_nhits.model.trainer.train_dataloader])

one gets the error:
MisconfigurationException: If learning rate/lr in 'model' or 'model.hparams' isn't overridden when 'auto_lr_find=True',...

Expected behavior

  • auto_lr_find to have effect
  • manual access to .tune() and it's plot output, which is quite useful for say setting up max learning rates in case of 1cycle policy.

System (please complete the following information):

  • Python version: 3.7.15
  • darts version 0.22.0

Additional context
It is entirely possible, that there is an obvious way to get these things to work, so please point me to any if! I found sadly none.

@solalatus solalatus added bug Something isn't working triage Issue waiting for triaging labels Nov 30, 2022
@solalatus
Copy link
Contributor Author

In a really not intuitive way, it happens to work.

For further reference:

lr_finder = model_nhits.model.trainer.tuner.lr_find(model_nhits.model, train_dataloaders=model_nhits.model.trainer._data_connector._train_dataloader_source.instance)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue waiting for triaging
Projects
None yet
Development

No branches or pull requests

1 participant