1. 首页
  2. 数据库
  3. 其它
  4. TypeError: only integer tensors of a single element can be converted to an index

TypeError: only integer tensors of a single element can be converted to an index

上传者: 2020-12-23 02:16:53上传 PDF文件 48.35KB 热度 189次
在调整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]
用户评论