-
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
LightningCLI dataclass support broken #9207
Comments
@leezu Can you report your exact
Running your repro code gets me:
Which is totally expected since it's not passing any default |
I see what the issue is. Before only subclasses were instantiated and then the instantiation of classes was added. However, since a dataclass is also a class and a group in the parser, it is trying to instantiate it. Even though the suggested fix would work, the proper fix would be that dataclasses are not considered for instantiation by |
@carmocca sorry for missing the script invocation instructions:
|
This is fixed in jsonargparse v3.19.1. |
🐛 Bug
Usage of simple dataclasses with LightningCLI broke with jsonargparse 3.14+ which is required in recent version of pytorch-lightning. I'm unable to reproduce the issue with jsonargparse directly (but haven't tried extensively) thus report it here.
Triggers
To Reproduce
Expected behavior
No crash.
Fix
@mauvilsa is above patch the correct fix? Or is this issue due to pytorch-lightning incorrectly calling jsonargparse?
The text was updated successfully, but these errors were encountered: