Pytorch Error Runtime RuntimeError: mat1 and mat2 shapes cannot be multiplied (10x2048 and 64x6)

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.