This error points to the target used in nn.CrossEntropyLoss or nn.NLLLoss having an invalid shape.
Your code is unfortunately not executable, so it’s not trivial to copy/paste it to fix other issues.
This error points to the target used in nn.CrossEntropyLoss or nn.NLLLoss having an invalid shape.
Your code is unfortunately not executable, so it’s not trivial to copy/paste it to fix other issues.