pointer-generator
pointer-generator copied to clipboard
Make compatible to TensorFlow past Nov 6, 2017
This changes the bit of the code which collects hyperparameters from command line flags into a named tuple. Since Nov 6 (commit 2652704), TensorFlow uses absl.flags
, which means FLAGS.__flags
does not map keys to values any longer, but to Flag
instances. Directly collecting those leads to errors later in the code:
Traceback (most recent call last):
[...]
self._example_queue = Queue.Queue(self.BATCH_QUEUE_MAX * self._hps.batch_size)
TypeError: unsupported operand type(s) for *: 'int' and 'Flag'
This PR avoids accessing the internal FLAGS.__flags
such that it works fine with old and new versions of TensorFlow.
This works fine. I wonder why this hasn't been accepted until now.
This is very useful. Thank you!