-
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
Save save_hyperparameters no longer respects linked arguments. #20311
Comments
Was the reproduction script supposed to be attached, but it isn't? |
The MWE is in the details. You can click the arrow to expand it. For convenience here it is in a gist as well: https://gist.github.com/Erotemic/dfdbf192004486e9f108b0334dd7fdcd |
I am also affected by this issue... :( |
Now I understand what the problem is. Later I will think about a proper solution and create a pull request. For the time being to disable the current behavior you can implement the following in your def _add_instantiators(self):
pass |
This behavior might have been introduced with the pytorch-lightning/src/lightning/pytorch/core/mixins/hparams_mixin.py Lines 125 to 131 in 1129d4c
|
@huangyxi yes, it is because of that, which is a change needed for the When I have the time I will work on a fix for this. I mentioned a workaround in my comment above. |
@mauvilsa , thanks for the quick workaround. |
I don't think that would slow down logging. There is no relation to it. |
Bug description
As of lightning 2.3.0
save_hyperparameters
no longer seems to respect linked arguments.Based on my investigation this seems to be due to #18105 which seems to have caused other errors, which were resolved, but as far as I can tell this one persists in the latest 2.4.0 and the master branch 66508ff
What version are you seeing the problem on?
v2.3, v2.4, master
How to reproduce the bug
Save the following script as:
lightning_cli_save_hyperaparams_error_on_link_args.py
Apologies for the length of the MWE, probably could be a few hundred lines shorter, but I had it on hand and it demonstrates the issue well enough. The link_arguments and model init is the important part:
Given the above script saved as
lightning_cli_save_hyperaparams_error_on_link_args.py
, I invoke it as:Error messages and logs
When using pytorch_lightning 2.2.5, running:
Correctly prints hyparams that include the
dataset_stats
linked arguments.But on the latest master branch and 2.4.0 it incorrectly prints:
Environment
Current environment
More info
No response
The text was updated successfully, but these errors were encountered: