yes, I thought that might be the problem too so I tried to do that today and it worked fine
could this be the problem (.long) I mean?
 loss = criterion(outputs, torch.squeeze(labels).long())

and if I remove it I get an error saying

Expected object of type torch.cuda.LongTensor but found type torch.cuda.FloatTensor for argument #2 ‘target’

and thank you for your help