Alright thank you! But know I got another error…
I resized the target tensor to a 1D tensor. The output tensor is a 2D one, but I still get this:
RuntimeError: AssertionTHIndexTensor_(size)(target, 0) == batch_size’ failed.  at /pytorch/torch/lib/THNN/generic/ClassNLLCriterion.c:79`
Does anyone know, what I did wrong?