I'm trying to develop an image captioning model. I'm referring to this Github repository. I have three methods, and they perform the following:
- Generates the image model
- Generates the caption model
- Concatenates the image and caption model together
Since the code is long, I've created a Gist to show the methods.
Here is a summary of my image model and caption model.
But then I run the code, I am getting this error:
TraceTraceback (most recent call last):
File "trainer.py", line 99, in <module>
model.fit([images, encoded_captions], one_hot_captions, batch_size = 1, epochs = 5)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/engine/training.py", line 950, in fit
batch_size=batch_size)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/engine/training.py", line 671, in _standardize_user_data
self._set_inputs(x)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/engine/training.py", line 575, in _set_inputs
assert len(inputs) == 1
AssertionError
Since the error is coming from Keras library, I have no idea how to debug this. But something is wrong when I try to concatenate them together.
I would like to know if I'm missing something here