Open WinterGan opened 6 months ago
Hi , I am currently working with DKT-F and encountered the following error: "Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!"
Hi, this issue is caused by the tensors are not on the same device. Could u provide more details about your errors?Such as which line did the error occur?
Hi , I am currently working with DKT-F and encountered the following error: "Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!"
Hi, this issue is caused by the tensors are not on the same device. Could u provide more details about your errors?Such as which line did the error occur?
File "/home/gzd/Desktop/pykt-toolkit/pykt/models/dkt_forget.py", line 56, in forward rgap, sgap, pcount = self.rgap_eye[rgap].to(device), self.sgap_eye[sgap].to(device), self.pcount_eye[pcount].to(device)
.rgap_eye[rgap].to(device), self.sgap_eye[sgap].to(device), self.pcount_eye[pcount].to(device)
The tensors of self.rgap_eye, self.sgap_eye and self.pcount_eye are not on GPUs. The following codes may work.
self.rgap_eye = torch.eye(num_rgap) --> self.rgap_eye = torch.eye(num_rgap).to(device) self.sgap_eye = torch.eye(num_sgap) --> self.sgap_eye = torch.eye(num_sgap).to(device) self.pcount_eye = torch.eye(num_pcount) --> self.pcount_eye = torch.eye(num_pcount).to(device)
您好,我运行最新的sparseKT模型,也遇到了类似的错误,而且报错的行很多。
Hi , I am currently working with DKT-F and encountered the following error: "Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!"