0

I just try to transfer to tensorflow 1.4.

But I noticed that TF1.4 does not support None value flag.

FLAGS = tf.app.flags.FLAGS
FLAGS.something = None # ERROR!(in TF1.4)

Here is my error.

File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/flags.py", line 66, in __setattr__
self._assert_required(name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/flags.py", line 74, in _assert_required
raise AttributeError('Flag --%s must be specified.' % flag_name)

It seems that self._assert_required raise an error. (it didn't exist in TF1.3)

https://github.com/tensorflow/tensorflow/blob/r1.4/tensorflow/python/platform/flags.py#L66

Why tensorflow 1.4 does not support None value flag? Is there any reason?

Junyeop Lee
  • 237
  • 2
  • 10

1 Answers1

0

As said here, Tensorflow is trying to make it as close as python-gflags. That's why this module is changed like this.

Also look at the commit message

Add mark_flag_as_required functions to make the APIs compatible with python-gflags.

Details could be found here.

Sumsuddin Shojib
  • 3,583
  • 3
  • 26
  • 45