Solved by ptrblck in post #3 
              
              
                You are overwriting the loss criterion name with the loss output tensor of the criterion, so that the next iteration will fail: 
# first iteration
# loss is the criterion here
loss = loss(output, labels.float())
# loss is a tensor from here on

# second iteration
# this will raise this error, since…