-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fix LightningCLI failing when both module and data module save hyperparameters #20221
base: master
Are you sure you want to change the base?
Fix LightningCLI failing when both module and data module save hyperparameters #20221
Conversation
…arameters due to conflicting internal parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, this is long overdue.
Just a suggestion and we're ready to merge
@@ -69,6 +69,9 @@ def _log_hyperparams(trainer: "pl.Trainer") -> None: | |||
lightning_hparams = pl_module.hparams_initial | |||
inconsistent_keys = [] | |||
for key in lightning_hparams.keys() & datamodule_hparams.keys(): | |||
if key.startswith("_"): | |||
# Prevent merging LightningCLI's internal hparams and discourage of private param names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we throw a warning here when a private param is skipped instead of doing it silently?
What does this PR do?
Fixes #20182
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--20221.org.readthedocs.build/en/20221/