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

caption.py strange output

Open efacco opened this issue 3 years ago • 5 comments

Hello, I used the pre-trained model and word map provided, and it seems to work but in caption.py I obtain always the same sentence with whatever picture, that is:

" a close up of a black and white background"

that makes me think that there is something wrong with the image preprocessing. Do you have any suggestions on how to understand better this problem and fix it?

Thanks

efacco avatar Mar 22 '21 07:03 efacco

I commented /.255 in the image processing and it was fine...How did it work for you?

efacco avatar Mar 22 '21 09:03 efacco

Hey, how are you loading the pretrained models provided? @efacco

I am getting this issue? Is it due to any PyTorch version problem?

    772     unpickler = pickle_module.Unpickler(f, **pickle_load_args)
    773     unpickler.persistent_load = persistent_load
--> 774     result = unpickler.load()
    775 
    776     deserialized_storage_keys = pickle_module.load(f, **pickle_load_args)

ModuleNotFoundError: No module named 'models'

adib0073 avatar Apr 19 '21 05:04 adib0073

you must put 2 file caption.py and model.py in the same directory

huavanson avatar Jun 20 '21 08:06 huavanson

I have the same problem as you, did you solve it?

adienxy avatar Jun 03 '23 04:06 adienxy

您好, 我使用了提供的预训练模型和词图, 它似乎可以工作,但是在 caption.py 中,我总是得到与任何图片相同的句子, 即:

“黑白背景的特写”

这让我觉得图像预处理有问题。 你对如何更好地理解这个问题并解决它有什么建议吗?

谢谢

I have the same problem as you, did you solve it?

adienxy avatar Jun 03 '23 04:06 adienxy