What's the purpose of tf.app.flags in TensorFlow?

前端 未结 5 1625

I am reading some example codes in Tensorflow, I found following code

flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_float(\'learning_rate\', 0.01, \         


        
5条回答
  •  半阙折子戏
    2020-12-04 07:29

    The tf.app.flags module is presently a thin wrapper around python-gflags, so the documentation for that project is the best resource for how to use it argparse, which implements a subset of the functionality in python-gflags.

    Note that this module is currently packaged as a convenience for writing demo apps, and is not technically part of the public API, so it may change in future.

    We recommend that you implement your own flag parsing using argparse or whatever library you prefer.

    EDIT: The tf.app.flags module is not in fact implemented using python-gflags, but it uses a similar API.

提交回复
热议问题