a-PyTorch-Tutorial-to-Image-Captioning icon indicating copy to clipboard operation
a-PyTorch-Tutorial-to-Image-Captioning copied to clipboard

Run captioning to my own images.

Open gxskar opened this issue 6 years ago • 5 comments

Sorry for the stupid question, but I am very new to machine learning applications. I have run your code until the point of having a checkpoint. I now want to produce a list of captions from some images that I have gathered. What are the steps for doing so? Again sorry, and thanks.

gxskar avatar Oct 11 '19 15:10 gxskar

I have been working on this tutorial for the past two weeks. As far as I understand, the forward method of the decoder cannot be used for inference, since it makes use of the technique called "teacher forcing". Basically, this means that to evaluate the model, you have to feed it not only an image, but also a caption !

This seem to defeat the purpose of modeling, because we would need to have a proper caption to generate one. This issue is actually adressed in the remarks : here

alexandre-blanc avatar Jan 11 '20 18:01 alexandre-blanc

Sorry for the stupid question, but I am very new to machine learning applications. I have run your code until the point of having a checkpoint. I now want to produce a list of captions from some images that I have gathered. What are the steps for doing so? Again sorry, and thanks.

Do you already have a trained model? If yes, then simply running caption.py on your images should work fine. This is because we're using beam search in the evaluation mode (i.e. it doesn't need a caption for the image. Just the images should be sufficient)

kmario23 avatar Jan 11 '20 22:01 kmario23

Sorry for the stupid question, but I am very new to machine learning applications. I have run your code until the point of having a checkpoint. I now want to produce a list of captions from some images that I have gathered. What are the steps for doing so? Again sorry, and thanks.

Do you already have a trained model? If yes, then simply running caption.py on your images should work fine. This is because we're using beam search in the evaluation mode (i.e. it doesn't need a caption for the image. Just the images should be sufficient)

Sorry, When I run caption.py, there is an ERROR, the decoder has no attribute decode_step, how to handle this issue?

Mollylulu avatar Mar 30 '20 05:03 Mollylulu

Could you show us the exact commands you used to :

  1. obtain the checkpoint
  2. run caption.py

as well as the full output in the terminal (i.e. the complete error message) ?

alexandre-blanc avatar Jun 10 '20 09:06 alexandre-blanc

Warning should be okay for running the code, which is caused by the Scipy version.

Best Regards Wanlu Luo

发件人: AnukritiSinghh 发送时间: 2020年7月31日 2:59 收件人: sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning 抄送: Mollylulu; Comment 主题: Re: [sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning] Run captioning to my own images. (#88)

I get the error caption.py:33: DeprecationWarning: imreadis deprecated!imreadis deprecated in SciPy 1.0.0, and will be removed in 1.2.0. Use imageio.imread instead. img = imread(image_path) caption.py:37: DeprecationWarning:imresizeis deprecated!imresize is deprecated in SciPy 1.0.0, and will be removed in 1.3.0. Use Pillow instead: numpy.array(Image.fromarray(arr).resize()). img = imresize(img,(256, 256)) and The default multichannel argument (None) is deprecated. Please specify either True or False explicitly. multichannel will default to False starting with release 0.16. warn('The default multichannel argument (None) is deprecated. Please ' — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Mollylulu avatar Aug 01 '20 02:08 Mollylulu