Capstone Project image caption bot

while training my model i got this error :
ValueError: could not broadcast input array from shape (81,2048) into shape (81)

I am not able to resolve it please help

colab : - https://colab.research.google.com/drive/1Ug02gYKpIsJAD1WxMtwbRMxnewoTRVts?usp=sharing

hey @singh.saurav701,
kindly grant me the access to view the above provided file.

Thank You :slightly_smiling_face:.

Sorry for late reply I have granted you the access

hey @singh.saurav701 ,
I don’t know the actual reason behind that error , but i am sure that is because of our data generator .
But yeah i did some changes in it and it worked correctly. Just the way you wanted it to be.
Change Done :
new Data generator output to be as
yield {"image_input":np.array(x1),"seq_input":np.array(x2)},np.array(y)

and added name parameter in Model Input Layers , being the same name as i used in above mentioned keys.
input_img_features = Input(shape=(2048,),name="image_input")
input_captions = Input(shape=(max_len,),name="seq_input")

I hope this helps you :slightly_smiling_face:.

Thank you
It worked :slightly_smiling_face:

no problem buddy .

I guess your doubt is now resolved, so if you haven’t marked this doubt as resolved , then i would request you to kindly mark it as such. And also do provide your valuable feedback as it helps us to improve this platform and provide your with better learning experience.

Thank you and Happy Learning :slightly_smiling_face:.