Problem training my Image Captioning model

I’m receiving this error on trying to train the model in Image Captioning Project. How do I resolve this issue?

I’m providing the link of the Jupyter Notebok as follows :

https://drive.google.com/file/d/1xMscd7YLnPsH42K287duTZpvJ3bzCjkc/view?usp=sharing

Please reply! :pray:

hey @Jalaanchal-Tewari-1816244721737412 ,
I am really sorry to reply you so late.
Just give me some time , i am working on your codes and will clear your doubt very soon.

Thank You :slightly_smiling_face:.

hey @Jalaanchal-Tewari-1816244721737412 ,
can you please provide me with links to files
Flickr_8k.trainImages.txt and Flickr_8k.testImages.txt.

I am not able to find them.

https://drive.google.com/drive/folders/14jwrWuSKHmaaADhzvH0xjfA9uxJEIk-P?usp=sharing

hey , @Jalaanchal-Tewari-1816244721737412 ,
I am really sorry to be so late , actually i was off for sometime due to my exams .
Will just let you know about your doubt.

Thanks for waiting.

hey @Jalaanchal-Tewari-1816244721737412 ,
Thank You for waiting.

There was some error in your data generator , although i also didn’t what the actual error was.
https://drive.google.com/file/d/1xMscd7YLnPsH42K287duTZpvJ3bzCjkc/view?usp=sharing

Have a look a at this link , i have modified the generator output a bit and also named model input layers . And this made your code working.
I hope this helps you. Have a look at it , if there is any doubt , you can ask me.

1 Like

I see that you changed the yield value in generator from

[[np.array(X1), np.array(X2)], np.array(y)]

(let’s call this yield value 1)

to

{“image_input”:np.array(X1), “caption_input”:np.array(X2)} , np.array(y)

(let’s call this yield value 2)

and then, the fit function worked.

When I used the yield value 1 in my local Jupyter Notebook, the fit function worked but when I used it in Google Colab, it threw a ValueError : No gradients provided for any variable.

The fit function works in Colab only if I use yield value 2.

Any idea why this is so?

I don’t know the exact reason , but it might be due to different versions of tensorflow and keras.

I am also getting the same error in colab how to solve this?

hey @Kishu1,
have a look at this https://drive.google.com/file/d/1xMscd7YLnPsH42K287duTZpvJ3bzCjkc/view?usp=sharing.

If still you are stucked , then i would request to kindly raise a new doubt on the discussion forum.
Thank You :slightly_smiling_face:.

This url does not exist

hey @Kishu1 ,
i am facing issue in my notebook .
So , i would request you too kindly create a new doubt for this and share your notebook along with it.
So that i am able your doubt more effectively.

Thank You :slightly_smiling_face:.

I have found the error
Thanks

Thats good.

All the best and Happy Learning :slightly_smiling_face:.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.