Since you have logsoftmax as last layer your output is log of softmax which gives you a tensor [64, 2]. And you’re trying to cast target tensor to shape of pred and it’s not clear how to do it.
And another thing that seems strange is that you have



 Julio:

nn.Linear(512, 2),


but you want to have 3 class classification. So i think you should change it to
nn.Linear(512, 3)

And another thing is last layer.
Are you sure you want to use logsoftmax instead of softmax? As softmax would just give you probability distribution over yout classes like [0.01, 0.5, 0.49].