Image-Captioning icon indicating copy to clipboard operation
Image-Captioning copied to clipboard

Mismatch of input with the model in "generate_captions"

Open avideep opened this issue 5 years ago • 0 comments

when I am running test.py with beach.jpg as input image, I am getting the following error. Traceback (most recent call last): File "test.py", line 27, in <module> text(image) File "test.py", line 17, in text image_captions = tm.generate_captions(sd, model, encoded_images, beam_size=3) File "/home/avideep/Downloads/Image-Captioning-master/test_mod.py", line 24, in generate_captions next_word_prob = model.predict([np.asarray([encoded_images]), np.asarray(iter_capt)])[0] File "/home/avideep/.local/lib/python3.6/site-packages/keras/models.py", line 899, in predict return self.model.predict(x, batch_size=batch_size, verbose=verbose) File "/home/avideep/.local/lib/python3.6/site-packages/keras/engine/training.py", line 1555, in predict check_batch_axis=False) File "/home/avideep/.local/lib/python3.6/site-packages/keras/engine/training.py", line 133, in _standardize_input_data str(array.shape)) ValueError: Error when checking : expected dense_1_input to have shape (None, 4096) but got array with shape (1, 1000)

Please help.

avideep avatar May 27 '19 14:05 avideep