facebookresearch / GENRE

Autoregressive Entity Retrieval
Other
756 stars 98 forks source link

Crash while using mention table #79

Closed xu1998hz closed 2 years ago

xu1998hz commented 2 years ago

I used "mention2wikidataID_with_titles_label_alias_redirect.pkl" and "wikidataID2lang_title-normalized_with_redirect.pkl" to add constraints on the search space. However, I received the following errors on one example.

The example was "LONDON, England (CNN) -- There are some circuits that are cornerstones of the Formula 1 calendar: the Monacos and [START] Silverstones [END] whose every twist and turn are known intimately by the drivers and engineers."

File ~/GENRE/fairseq/fairseq/sequence_generator.py:902, in (.0) 899 else: 900 print(finalized) 901 attn = [ --> 902 finalized[i // beam_size][i % beam_size]["attention"].transpose(1, 0) 903 for i in range(bsz * beam_size) 904 ] 906 if src_tokens.device != "cpu": 907 src_tokens = src_tokens.to("cpu")

IndexError: list index out of range

nicola-decao commented 2 years ago

Your installation of fairseq seems odd. Why do you have print(finalized)?

nicola-decao commented 2 years ago

Did you use my version of fariseq?

xu1998hz commented 2 years ago

I just printed myself to figure out some potential bugs

xu1998hz commented 2 years ago

Yes, version is correct. The code works OK without using mention table

nicola-decao commented 2 years ago

Show me the code you are running