-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Update Checkpointing Docs to include details on initializing model with other hyperparameters #17767
base: master
Are you sure you want to change the base?
Conversation
…el with other hyperparameters Currently, docs do not include information that positional arguments will not be forwarded to the model. All examples include only keyword arguments. This bug causes many wasted hours of debugging every time.
@@ -108,7 +108,7 @@ The LightningModule also has access to the Hyperparameters | |||
|
|||
Initialize with other parameters | |||
================================ | |||
If you used the *self.save_hyperparameters()* method in the init of the LightningModule, you can initialize the model with different hyperparameters. | |||
If you used the *self.save_hyperparameters()* method in the init of the LightningModule, you can initialize the model with different hyperparameters. Named arguments passed to ``load_from_checkpoint`` will be forwarded to the model's ``__init__`` function, with the exception of arguments named ``strict``, ``map_location``, and ``hparams_file``, which are consumed by ``load_from_checkpoint``. Positional arguments will **not** be forwarded to the model. |
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.
Overall looks like a good addition, thanks!. Two minor comments:
- The last sentence sounds a bit misleading. "will not be forwarded" sounds like we are silently not doing anything with them, but in fact it is just not supported and will raise an error. Forcing this best practice is to avoid collision and user-error.
- Maybe the comment could be added at the bottom of the section, since it is better to introduce the user with the concept and the code examples first before pointing out additional details of optional usage patterns.
What do you think?
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If you need further help see our docs: https://lightning.ai/docs/pytorch/latest/generated/CONTRIBUTING.html#pull-request or ask the assistance of a core contributor here or on Discord. Thank you for your contributions. |
@shubhamkulkarni01 mind pls check the merge conflicts? |
|
GitGuardian id | Secret | Commit | Filename | |
---|---|---|---|---|
- | Generic High Entropy Secret | 78fa3af | tests/tests_app/utilities/test_login.py | View secret |
- | Base64 Basic Authentication | 78fa3af | tests/tests_app/utilities/test_login.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
What does this PR do?
Currently, docs do not include information that positional arguments will not be forwarded to the model. All examples include only keyword arguments. This bug causes many wasted hours of debugging every time.
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