赞
踩
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking arugment for argument mat1 in method wrapper_addmm)
首先,找到报错的那行代码,然后,在后面加上**.cuda()**
例如
test_class_word_embedding = data[‘test_class_word_embedding’].cuda() test_class_word_embedding = self.fc(test_class_word_embedding).cuda()
一直报错self.fc这行代码,把用的数据加上 .cuda()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。