2

I am going to use tensor flow package to run models/rnn/ptb/ ptb_worl_lm.py. However, I have got this error in seq2Seq.py,

line 653, in sequence_loss_by_example

log_perps /= total_size

TypeError: unsupported operand type(s) for /=: 'Tensor' and 'Tensor'

I am using Ubuntu, and python 2.7.

Community
  • 1
  • 1
afsaneh
  • 21
  • 4

1 Answers1

1

Are you running with the released version of tensorflow and using a post-release model, by chance? This sounds a lot like Github issue 293. My suggestion would be to either: (a) Update your install; (b) Try removing the from __future__ import division from the top of the file; or (c) changing the line to invoke the underlying log_perps = tf.div(log_perps, total_size) function directly.

(b) or (c) is the fastest fix, but in the long run, I'd go with (a).

dga
  • 21,757
  • 3
  • 44
  • 51