microsoft / unilm

Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities
https://aka.ms/GeneralAI
MIT License
19.11k stars 2.44k forks source link

RuntimeError: gather_out_cuda(): Expected dtype int64 for index #833

Open Aniruddha-JU opened 1 year ago

Aniruddha-JU commented 1 year ago

Describe the bug I am using UniLM-V1 https://github.com/microsoft/unilm/tree/master/unilm-v1/src/biunilm/decode_seq2seq.py. for generation using beam size 3 for indian languages, and getting above error. My code was running successfully earlier (I guess Novembe,21). But now it is getting this error.

donglixp commented 1 year ago

The error message is missing.

Aniruddha-JU commented 1 year ago

File "/home/aniruddha/anaconda3/envs/rupak_qg/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "/home/aniruddha/Rupak_QG/meta_learning/pytorch_pretrained_bert/modeling.py", line 1525, in forward return self.beam_search(input_ids, token_type_ids, position_ids, attention_mask, task_idx=task_idx, mask_qkv=mask_qkv) File "/home/aniruddha/Rupak_QG/meta_learning/pytorch_pretrained_bert/modeling.py", line 1732, in beam_search prev_embedding, back_ptrs) File "/home/aniruddha/Rupak_QG/meta_learning/pytorch_pretrained_bert/modeling.py", line 1703, in select_beam_items y = torch.gather(x, 1, ids) RuntimeError: gather(): Expected dtype int64 for index