Chinese_Coreference_Resolution icon indicating copy to clipboard operation
Chinese_Coreference_Resolution copied to clipboard

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

Open iooops opened this issue 2 years ago • 5 comments

跑训练的时候报错

iooops avatar Dec 21 '22 10:12 iooops

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)

iooops avatar Dec 21 '22 10:12 iooops

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

cuikai-ai avatar Apr 09 '23 01:04 cuikai-ai

没有

iooops avatar Apr 10 '23 17:04 iooops

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

lixiaoxiaobin avatar Jun 02 '23 03:06 lixiaoxiaobin

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

heguyu avatar Dec 18 '23 08:12 heguyu