sgrvinod / a-PyTorch-Tutorial-to-Image-Captioning

Show, Attend, and Tell | a PyTorch Tutorial to Image Captioning
MIT License
2.75k stars 711 forks source link

eval.py script is not working #157

Open LealemTilahun opened 3 years ago

LealemTilahun commented 3 years ago

Hi @sgrvinod, i tried to run eval.py but "ValueError: max() arg is an empty sequence" error msg is displaying. how can i fix this error please!

xieanheng commented 3 years ago

You can set beam_size at a big num,maybe it will work.

And once I have meet this problem,can not evaluate it at beam_size=5,after I train an other model at same parameters,it is work!

aliciaviernes commented 2 years ago

A bigger beam size yields another problem. What if you have trained a model in the same parameters, but with a different dataset?

jainnipun11 commented 2 years ago

Was the ValueError issue resolved? If yes, then how?

Thanks.

Lydia-727 commented 2 years ago

Hello! I met the same issue.How did you fixed it? please help~ Thank you very much!

jainnipun11 commented 2 years ago

Hello! Make sure you are assigning the latest .json file generated to the data folder. If that doesn't work, try adding "img_as_float" while reading the images in preprocessing and "img_as_ubyte" while resizing. Run create_input_files.py. Replace the files generated in the output folder to the ones already present in data folder and train again. This should solve the issue. Thanks!

Lydia-727 commented 2 years ago

Hello! Make sure you are assigning the latest .json file generated to the data folder. If that doesn't work, try adding "img_as_float" while reading the images in preprocessing and "img_as_ubyte" while resizing. Run create_input_files.py. Replace the files generated in the output folder to the ones already present in data folder and train again. This should solve the issue. Thanks!

Thanks for your reply. Actually,I tried to set beam_size=3,and it works. I will try your solution later.Thanks!