Solved by ptrblck in post #8 
              
              
                Thanks for the code. 
You are overwriting the criterion after its definition: 
criterion = nn.CrossEntropyLoss()
model = model.to(device)
criterion = model.to(device)