3
3
3
[torch.cuda.LongTensor of size 3x1 (GPU 0)]
RuntimeError: multi-target not supported at /home/jcc/pytorch/torch/lib/THCUNN/generic/ClassNLLCriterion.cu:17
The docs say that the second return value of torch.max is indeed a LongTensor. Does wrapping it in a Variable work for you? ie loss = criterion(preds, Variable(target))
Sorry, I didn’t read the error message in your above post. The error message suggests that target should be a vector, not a 3x1 tensor – you can fix that with target.squeeze(1)
Hello, am receiving this error with some fastai custom classes.
Have not discovered where to try to squeeze the target.
In case you are familiar with the package it involves ColumnModelData and
a StructuredLearner with CrossEntropyLoss.
Not sure this is the error type but it is my top suspect.