Implementing from_argparse_args in LightningModule. #12702
Unanswered
DuaneNielsen
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I spent a couple hours trying to come up with a minimal example illustrating how to implement from_argparse_args on a Lightning Module.
This is what I came up with...
Essentially, it scans the class init arguments using the inbuilt tools, and uses them to make the argparse args.
This requires you add type information to the class init.
improvements/critiques welcome!
"lr": 0.0001
"model_name": hello_world
"lr": 0.0001
"model_name": tarantula
Beta Was this translation helpful? Give feedback.
All reactions