https://www.tensorflow.org/api_docs/python/tf/flags
$ python file.py --[parameter_name]
$ python file.py --help
# Create a flag for definition
flags = tf.app.flags
# Create a flag for reference
FLAGS = flags.FLAGS
# Definition of string
flags.DEFINE_string (constant name, initial value, description)
# Definition of float
flags.DEFINE_float (constant name, initial value, description)
# definition of int
flags.DEFINE_integer (constant name, initial value, description)
# Definition of bool
flags.DEFINE_boolean (constant name, initial value, description)
# Constant reference
print (FLAGS. Constant name)
Recommended Posts