TypeError: only integer tensors of a single element can be converted to an index
在调整loss计算的时候遇到了TypeError: only integer tensors of a single element can be converted to an index这个问题,原来的计算公式为: self.loss_D = (self.loss_D_fake + self.loss_D_real) * 0.5 调整后的公式为: # train.lcf[train.lcfCountD]为修正系数 self.loss_D = (self.loss_D_fake + self.loss_D_real) * 0.5 * train.lcf[train.lcfCountD]
用户评论