Closed haofengsiji closed 4 years ago
The 3rd argument index should be batch_labels.view(-1,1) and you just need to change it to
_one_hot_labels = Variable(torch.zeros(BATCH_NUM_PER_CLASS*CLASS_NUM, CLASSNUM).scatter(1, batchlabels.view(-1,1).long(), 1).cuda(GPU))
py27 may also solve this problem, but still, thanks
I have already tried my best to solve this problem. But I failed, can anyone give me some suggestions?