Skip to content
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

Simplify backbone_image_classifier example #7246

Merged
merged 5 commits into from
Apr 28, 2021
Merged

Simplify backbone_image_classifier example #7246

merged 5 commits into from
Apr 28, 2021

Conversation

mauvilsa
Copy link
Contributor

@mauvilsa mauvilsa commented Apr 28, 2021

What does this PR do?

In a slack discussion about LightningCLI it was suggested that untyped parameters should be added to the parser as type Any instead of being silently skipped. With the latest version of jsonargparse this is the behavior, however, this means that in the current backbone_image_classifier example the argument model.backbone will be added twice causing a failure. There is a temporal patch in jsonargparse so that this example does not fail, but this will be removed in the next version. The backbone_image_classifier has to change due to this, but also it can be made simpler as proposed here.

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

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:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented Apr 28, 2021

Codecov Report

Merging #7246 (187c15d) into master (7a48db5) will decrease coverage by 4%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #7246    +/-   ##
=======================================
- Coverage      91%     87%    -4%     
=======================================
  Files         199     199            
  Lines       12799   12799            
=======================================
- Hits        11701   11147   -554     
- Misses       1098    1652   +554     

@mauvilsa mauvilsa marked this pull request as ready for review April 28, 2021 06:29
@mauvilsa
Copy link
Contributor Author

@carmocca this change is according to our discussion in slack.

Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@carmocca carmocca added this to the v1.3 milestone Apr 28, 2021
Copy link
Contributor

@carmocca carmocca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means that in the current backbone_image_classifier example the argument model.backbone will be added twice causing a failure.

Why is this the case?
edit: nvm, realized it's due to

    def add_arguments_to_parser(self, parser):
        parser.add_class_arguments(Backbone, 'model.backbone')

@carmocca carmocca added argparse (removed) Related to argument parsing (argparse, Hydra, ...) example labels Apr 28, 2021
@mergify mergify bot removed the has conflicts label Apr 28, 2021
@carmocca carmocca enabled auto-merge (squash) April 28, 2021 23:25
@carmocca carmocca merged commit b0cd9da into Lightning-AI:master Apr 28, 2021
@mauvilsa mauvilsa deleted the cli_untyped_implies_any branch April 29, 2021 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
argparse (removed) Related to argument parsing (argparse, Hydra, ...) example
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants