Solved by ptrblck in post #11 
              
              
                I had a look at your code and it seems your error calculation does overflow. 
In this method you are calculating the error: 
def error_criterion(outputs,labels):
    max_vals, max_indices = torch.max(outputs,1)
    train_error = (max_indices != labels).sum().data[0]/max_indices.size()[0]
    return …