In the line
for t, p in zip(classes.view(-1), preds.view(-1)):

either classes or preds (or both) is a tuple, when it should be a tensor.
It might be preds, that should maybe be pred, because on the line just before we have _, pred = torch.max(outputs.data,1)
Or it might be classes, that should maybe be labels, because a few lines before we get the tensor labels that is never used.
Or maybe both ?