Skip to content

store_true for bools in the trainer's argparse parser #1168

@nateraw

Description

@nateraw

🚀 Feature

Do we want to have action='store_true' for any args in the default trainer argument parser?

Motivation

Currently, the bool parameters must be passed like:

python main.py --fast_dev_run True

It would be nice to just pass that as a flag:

python main.py --fast_dev_run

However, once I started looking into it, I noticed why this is not the case. You might have True values that you'd like to set to False. If you use action='store_false', you're left with a confusing flag. For example, this doesn't intuitively feel like it would be turning off the progress bar.

python main.py --show_progress_bar

Pitch

We could set all bool type parameters with a default of False to use action='store_true'. Truly not sure if this makes the interface more confusing to an end user. I find it more intuitive, but I'd like to hear others' thoughts.

Alternatives

  1. We could ignore this and leave it the way it is
  2. We could explicitly set a few parameters to use action='store_true' (i.e. fast_dev_run)
  3. We could flip bool parameters like show_progress_bar that default to True to something like hide_progress_bar and then do what was suggested in the "Pitch".

Additional context

Here's a quick fork where I did what I suggested in the Pitch

Metadata

Metadata

Assignees

Labels

discussionIn a discussion stagefeatureIs an improvement or enhancementhelp wantedOpen to be worked on

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions