I am using tf.app.flags
to parse command line arguments in my code. Is there any way I can make some flags as necessary (as in argparse
)? Using default value as None
doesn't seem to help
Asked
Active
Viewed 525 times
0

gokul_uf
- 740
- 1
- 8
- 21
-
1Did you have a look at https://stackoverflow.com/questions/37305560/how-can-one-mark-a-flag-as-required-with-gflags since tf's flags resemble gflags? – etarion Oct 27 '18 at 18:56
-
Thanks, apparently, tf's flags is actually abseil flags (formerly gflags), they just import it internally :/ – gokul_uf Oct 27 '18 at 19:27
1 Answers
1
Thanks to @etarion 's comment, it seems the correct method to use is flags.mark_flag_as_required
. Note that this won't work if the default value is not None
.

gokul_uf
- 740
- 1
- 8
- 21