Janus-Shiau / lookahead_tensorflow

Lookahead optimizer ("Lookahead Optimizer: k steps forward, 1 step back") for tensorflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: unsupported operand type(s) for +=: 'Operation' and 'list'

remifan opened this issue · comments

commented

error at train_op = train_op + lookahead.get_ops()

Tensorflow: 1.11.0
Python: 3.5.2

Hi @remi-nd,

I usually maintain the train_op as a list of operators.
In your case, I think simple using train_op = [train_op] + lookahead.get_ops() will be helpful.

FYI, a simple example of using lookahead.get_ops() and train_op can be found in the new commit.

Thank you!