Come across a error that generating index excessing the size of voc

I am working on a summarization project.
My model has the encoder-decoder structure when the decoder generates the sentence, sometimes it will
give out an index of the predicted word which is out of the size of word2id dict.

This is the error I came across.