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

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

Indexerror from caption.py #169

Open tiva-OG opened 2 years ago

tiva-OG commented 2 years ago

https://github.com/sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning/blob/cc9c7e2f4017938d414178d3781fed8dbe442852/caption.py#L107

prev_word_inds returns a float. I really don't understand why the division there. Someone should please help me out. Thanks.

dcdc2260 commented 2 years ago

https://github.com/sgrvinod/a-PyTorch-Tutorial-to-Image-Captioning/blob/cc9c7e2f4017938d414178d3781fed8dbe442852/caption.py#L107

prev_word_inds returns a float. I really don't understand why the division there. Someone should please help me out. Thanks.

Hello!you could change '/' to '//',The result should be int