Closed Adorablepet closed 4 years ago
i have the same questios, have u sove it?
@LcenArthas I have solved.
def forward(self, logits, labels):
labels = labels.cuda()
loss = F.cross_entropy(input=logits, target=labels, weight=self.weight)
return loss
Thanks for sharing code.I have modified the code. I want to calculate the multivariate classification. The code is as follows. I can always report errors. I wonder if you have tried it?
Thanks.