Hi
Looking at the error log, I think the problem is in the file “loss.py” when the line
return nn.CrossEntropyLoss(output, target)
is executed.
It seems that you’re returning a CrossEntropyModule which is intialized with two parameters “output” and “target”.
But the module constructor expects weights and some boolean flags (average and reduce), so when it sees a Tensor (target in this case) it gives you that error.
I can’t see the code but I’m assuming you want to compute the loss given the model outputs and the targets without instantiating any modules.
If this is the case you can try to use torch.nn.functional.cross_entropy
Hope this helps in finding the problem