jazzsaxmafia / show_and_tell.tensorflow

BSD 2-Clause "Simplified" License
291 stars 92 forks source link

ValueError: setting an array element with a sequence. #22

Open puneetvaza opened 7 years ago

puneetvaza commented 7 years ago

fc7_tf, generated_words_tf = caption_generator.build_generator(maxlen=maxlen) in ipython_demo f state = tf.zeros([1, self.lstm.state_size]) in model.py i am using python 2.7 and tf 1.3.0 i am getting this error and how i can resolve it. and will be able to run the code properly .

SilencerChen commented 7 years ago

Have you solved it ? I have the same problem and I don't know how to deal with it. It would be so great if you can tell me what should I do.

336655asd commented 6 years ago

I have the question too. I searched on the stackoverflow and know that there is something with the shape of tensor. However ,when I change the 'self.lstm.state_size' to [256,256],another question happend.

laiaaa0 commented 6 years ago

Change the line self.lstm = BasicLSTMCell(dim_hidden) to self.lstm = BasicLSTMCell(dim_hidden,state_is_tuple=False)

Jason-xin commented 6 years ago

state =self.lstm.zero_state(1, dtype=tf.float32)