解决方式之一Caught AttributeError in replica 0 on device 0.

Caught AttributeError in replica 0 on device 0.

Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cuda:1! (when checking arugment for argume

原因和解决方式之一
下面这个不止用了一次,位置也不对
self.model = nn.DataParallel(self.model)#.cuda()

你可能感兴趣的:(代码相关,python,开发语言)