DeepRNN / image_captioning

Tensorflow implementation of "Show, Attend and Tell: Neural Image Caption Generation with Visual Attention"
MIT License
785 stars 354 forks source link

Have a question in model.py #8

Open leojwp opened 6 years ago

leojwp commented 6 years ago

File "/home/cao/semantic-IQA/image-caption-tensorflow/image_captioning-master/model.py", line 449, in build_rnn opt_op = solver.apply_gradients(zip(gs, tvars), global_step=self.global_step)
ValueError: Variable emb_w/Adam/ does not exist, or was not created with tf.get_variable(). Did you mean to set reuse=None in VarScope?

loganlebanoff commented 6 years ago

I solved this using the following link: https://github.com/tensorflow/tensorflow/issues/6220

You need to surround the model construction part with a new variable scope, and make sure it doesn't include the Adam solver lines of code.

tdcqhxr commented 6 years ago

@loganlebanoff can you say more detail? I meet same problem. thanks in advance!