Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while running test.py #3

Open
LinuxBeginner opened this issue Aug 9, 2019 · 0 comments
Open

Error while running test.py #3

LinuxBeginner opened this issue Aug 9, 2019 · 0 comments

Comments

@LinuxBeginner
Copy link

LinuxBeginner commented Aug 9, 2019

The training was successful.

After that, I put all the test images inside the test_data-> crop_test, changed the path as
'test_data_path': 'test_data/crop_test/'

Changed this also after the completion of training

'model_load_path': 'model_data/model_inceptionv3_epoch-07_train_loss-2.7715_val_loss-3.5321.hdf5'

Generating caption for 2377.jpg
Traceback (most recent call last):
File "test.py", line 59, in
generated_caption = generate_caption_beam_search(caption_model, tokenizer, image, max_length, beam_index=config['beam_search_k'])
File "/home/Image-Caption-Generator/utils/model.py", line 140, in generate_caption_beam_search
preds = model.predict([image,padded_seq], verbose=0)
File "/home/img-cap/lib/python3.6/site-packages/keras/engine/training.py", line 1149, in predict
x, _, _ = self._standardize_user_data(x)
File "/home/img-cap/lib/python3.6/site-packages/keras/engine/training.py", line 751, in _standardize_user_data
exception_prefix='input')
File "/home/img-cap/lib/python3.6/site-packages/keras/engine/training_utils.py", line 138, in standardize_input_data
str(data_shape))
ValueError: Error when checking input: expected input_2 to have shape (33,) but got array with shape (40,)

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant