RuntimeError: multi-target not supported at /Users/soumith/miniconda2/conda-bld/pytorch_1532623076075/work/aten/src/THNN/generic/ClassNLLCriterion.c:21

If you are using nn.CrossEntropyLoss or nn.NLLLoss your target should contain the class indices as your link suggests.
However, currently your target seems to contain some kind of video features.
Could you explain a bit more about the values in the target?

E.g. if you are dealing with float features, you might want to use nn.MSELoss, which expects the output and target to have the same shape.

EDIT: It looks like you are casting the target to torch.long, which indicates some kind of class indices?
Could you post an example target with values?

1 Like