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

always returns the same caption

Open ada-dl opened this issue 4 years ago • 3 comments

I used the pretrained checkpoint and wordmap, when I ran it through different images, it always returns the same caption? Why could this be? Could you please help me?

ada-dl avatar Mar 04 '20 15:03 ada-dl

I had the same problem and commenting out img = imresize(img, (256, 256)) [line 36 in caption.py], thus not resizing the input resolved the issue.

maotaitas avatar Mar 09 '20 14:03 maotaitas

It's better to add img_as_ubyte to change img array from float to integer.

img = img_as_ubyte(imresize(img, (256, 256)))

fragno avatar Jun 21 '20 01:06 fragno

that

It's better to add img_as_ubyte to change img array from float to integer.

img = img_as_ubyte(imresize(img, (256, 256)))

this helped perfectly, thank you

nsharan2000 avatar Jul 12 '20 13:07 nsharan2000