-
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
Changed basic_examples to use LightningCLI #6862
Changed basic_examples to use LightningCLI #6862
Conversation
@carmocca An example changed to use |
Should the LightningCLI allow {fit,validate,test,tune,predict}? So by default you can do:
Also yes, And what do you think about
|
At first glance it makes sense. But I have only used lightning for training. I will need to look into
Should I add in this pull request the
This is not possible. It is a class so it can only return the instance. Anyway the instance has these as attributes so there is no much difference. |
Awesome!
Yes, I think that's okay |
…he examples. - Increased minimum required jsonargparse version to 3.9.0. - Improvements to simple_image_classifier.py example. - Changed autoencoder.py and backbone_image_classifier.py examples to use LightningCLI. - Updated pl_examples/test_examples.py so that tests succeed.
Codecov Report
@@ Coverage Diff @@
## master #6862 +/- ##
=======================================
- Coverage 92% 87% -5%
=======================================
Files 194 194
Lines 12386 12391 +5
=======================================
- Hits 11414 10770 -644
- Misses 972 1621 +649 |
Implemented seed_everything in LightningCLI. Also updated two other examples required so that |
- Changed dali_image_classifier.py example to use LightningCLI. - Simplified use of LightningCLI in autoencoder.py, backbone_image_classifier.py and simple_image_classifier.py. - Adapted other files related to the changed examples.
Hello @mauvilsa! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-04-13 17:46:05 UTC |
From the basic_examples only two have not been updated yet:
|
So this ties into value interpolation. Would something like this be possible? parser.add_argument("--data.batch_size", default="${model.batch_size}") |
It is intended to avoid the need for doing interpolation for cases in which interpolation shouldn't be used because it just adds complexity to the config file even though it is something that should be hard coded. There are other cases in which interpolation is a valid need.
No, my idea is not having some special values in default. This would be limiting anyway because this is normally needed when arguments are added automatically from class signatures. It would be configured after the arguments are already added making it possible to still validate using the original type. So it could be running |
Would this have the transitive property? Also, this discussion should continue in the |
The question relevant for this pull request was how to handle a case like |
What does this PR do?
Changed
autoencoder.py
,backbone_image_classifier.py
,profiler_example.py
andsimple_image_classifier.py
in pl_examples to use the new LightningCLI. Related to the examples some improvements are also made to LightningCLI that seemed necessary.Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃