troublemaker-r / Chinese_Coreference_Resolution

基于SpanBert的中文指代消解,pytorch实现
95 stars 20 forks source link

RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) #18

Open iooops opened 1 year ago

iooops commented 1 year ago

跑训练的时候报错

iooops commented 1 year ago
candidate_starts = candidate_starts.view(-1)[flattened_candidate_mask]    # [num_candidates]

RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

cuikai-ai commented 1 year ago

遇到了同样的问题,请问你解决了吗,是怎么解决的?

iooops commented 1 year ago

没有

lixiaoxiaobin commented 1 year ago

也遇到了这个gpu和cpu乱用的问题,求解

heguyu commented 11 months ago

image 出问题的代码添加to("cuda:0") image