When I train on a classification model by Longformer
def forward(self,input):
embding=input['enc']
att_mask=input['mask']
att_mask[:,[100,300,500,800,1200,]]=2
labels=input['targets']
print('jeff:',embding.device,att_mask.device,self.l1.device,embding.shape,att_mask.shape,self.maxlen)
logit=self.l1(inputs_embeds=embding,attention_mask=att_mask)#[:2]
return [logit,labels]
Meet error:
pytorch/aten/src/THC/THCTensorIndex.cu:361: void indexSelectLargeIndex(TensorInfosrcIndex < srcSelectDimSize failed
max_num_extra_indices_per_batch = num_extra_indices_per_batch.max()
RuntimeError: cuda runtime error (710) : device-side assert triggered at /pytorch/aten/src/THC/THCReduceAll.cuh:327
I checked the length of the attention_mask is same as the config.max_len which is like [bs,max_len]
Do anyone meet the same issue?
A link to original question on the forum/Stack Overflow:
i fixed finally
i fixed finally
What was the solution?
@Yangxiaojun1230 How to fix it? I meet this problem too.