pointer-generator icon indicating copy to clipboard operation
pointer-generator copied to clipboard

Make compatible to TensorFlow past Nov 6, 2017

Open f0k opened this issue 6 years ago • 2 comments

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.

f0k avatar Dec 18 '17 17:12 f0k

This works fine. I wonder why this hasn't been accepted until now.

nikhilweee avatar Apr 16 '18 04:04 nikhilweee

This is very useful. Thank you!

zhenduow avatar Jan 28 '20 06:01 zhenduow