Hi,
I am trying to compile your code on the latest version of TF (1.7) but it throws this error:
"Traceback (most recent call last):
File "model.py", line 332, in
train() # Do not use pretrained model.
File "model.py", line 212, in train
loss, image, sentence, mask = caption_generator.build_model()
File "model.py", line 82, in build_model
output, state = self.lstm( current_emb, state ) # (batch_size, dim_hidden)
File "/anaconda/envs/python2/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 298, in call
*args, *kwargs)
File "/anaconda/envs/python2/lib/python2.7/site-packages/tensorflow/python/layers/base.py", line 714, in call
outputs = self.call(inputs, args, **kwargs)
File "/anaconda/envs/python2/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 574, in call
c, h = state
File "/anaconda/envs/python2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 400, in iter
"Tensor objects are not iterable when eager execution is not "
TypeError: Tensor objects are not iterable when eager execution is not enabled. To iterate over this tensor use tf.map_fn."
It looks like an error because the code was written in TF 0.1. Could you please change your code so that it runs on the latest version of TF?
Hi, I am trying to compile your code on the latest version of TF (1.7) but it throws this error: "Traceback (most recent call last): File "model.py", line 332, in train() # Do not use pretrained model. File "model.py", line 212, in train loss, image, sentence, mask = caption_generator.build_model() File "model.py", line 82, in build_model output, state = self.lstm( current_emb, state ) # (batch_size, dim_hidden) File "/anaconda/envs/python2/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 298, in call *args, *kwargs) File "/anaconda/envs/python2/lib/python2.7/site-packages/tensorflow/python/layers/base.py", line 714, in call outputs = self.call(inputs, args, **kwargs) File "/anaconda/envs/python2/lib/python2.7/site-packages/tensorflow/python/ops/rnn_cell_impl.py", line 574, in call c, h = state File "/anaconda/envs/python2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 400, in iter "Tensor objects are not iterable when eager execution is not " TypeError: Tensor objects are not iterable when eager execution is not enabled. To iterate over this tensor use tf.map_fn." It looks like an error because the code was written in TF 0.1. Could you please change your code so that it runs on the latest version of TF?
Thanks Rahul