Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper__index_select)

数据不在同一设备

将device = d2l.try_gpu()
改为device = torch.device('cpu')

62seq2seq

posted @ 2022-07-06 20:31  荒北  阅读(1356)  评论(0)    收藏  举报