-
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
Allow boolean flags to work without passing True #1829
Comments
This only seems to be a problem with the |
it's a problem for many flags haha. The pattern is bool or the callback or string. So, early stopping, checkpoint, etc... all have this problem. auto_lr_find=True
auto_lr_find='some.path' But True is getting parsed as a string which breaks everything. |
I think we need to solve this before 0.7.6 release as this is causing a lot of unexpected behaviors @Borda. Basically i think we need to:
|
I think that the complication comes with |
well this is the minimal solution import argparse
p = argparse.ArgumentParser()
p.add_argument("--a", type=str, default=False, nargs="?")
v = vars(p.parse_args())
v = {k: True if v is None else v for k, v in v.items()}
print(v) gives:
|
let's merge this asap for 0.7.6 |
ready to review... ^^ @williamFalcon |
We tried to fix this but it's still broken
This fails when adding args to argparse automatically...
Instead we have to do:
which is not great
The text was updated successfully, but these errors were encountered: