ValueError(f"{func} does not have a return type annotation") when implementing LightningCLI #19637
-
Dear All, I am trying to implement the LightningCLI class, but it tells me my model does not have any Type annotation, although I added class function type return type annotation. What am I doing wrong? Thank you for your input! LG Max |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@djtschke it is difficult to say what you are doing wrong without seen the code you are running. Please provide a minimal reproduction example. |
Beta Was this translation helpful? Give feedback.
-
Hi Mauvilsa, thank you for your reply. While trying to come up with a minimal reproduction example I actually found the solution to my problem: Wrong / Not Working:
Correct / Working:
Hope that also helps others! Cheers, Max |
Beta Was this translation helpful? Give feedback.
Hi Mauvilsa,
thank you for your reply. While trying to come up with a minimal reproduction example I actually found the solution to my problem:
LightningCLI() does not take the instance of the model as a parameter but the class itself (as I guess instantiation is then done by the pipeline itself). To be more clear:
Wrong / Not Working:
Correct / Working: