Hi K. Frank,
print(‘Epoch: %d/%d, Train acc : %0.2f, Test acc : %0.2f’ % (epoch, max_epochs, evaluation(trainloader,resnet), evaluation(testloader,resnet)) )
when i run this, i get the following output
I’m printing  outputs = model(inputs)
print(outputs)
_, pred = torch.max(outputs.data,15)
print(pred) within the evaluation function
tensor([[-1.3976, -1.9027, -0.8711,  …, -1.4458, -1.2116, -0.8598],
[-0.3187, -0.8117, -1.0978,  …, -2.2132, -1.3070, -0.9956],
[-0.8397, -1.6915, -0.6634,  …, -1.8321, -1.0346, -1.2636],
…,
[-1.4526, -1.1693, -1.0159,  …, -1.3135, -1.1257, -0.9665],
[-1.3092, -1.4912, -1.3867,  …, -2.0305, -1.1680, -1.3192],
[-0.5745, -1.1265, -0.9143,  …, -2.1783, -0.6507, -1.4715]],
grad_fn=)
tensor([ 3,  3,  5,  3,  3,  3,  3,  7,  3,  3,  3,  3,  3,  3,  7,  3,  3,  3,
3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
13,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  9,  3,  3,  3,  3,  3,  3,
3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
3,  3,  3,  3,  3,  3,  3,  3,  2,  3,  3,  5,  3,  3,  3,  3,  3,  3,
3,  3,  3,  8,  5,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  8,  3,  3,
3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  5,  3,  5,  3,  3,
3,  3,  3,  3,  3,  3,  2,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
3,  3,  3,  3,  3,  3,  3,  3,  8,  3,  3,  3,  3,  3,  5,  2,  3,  3,
3,  3,  3,  3,  5,  5,  3,  2,  3,  3,  3,  3,  3,  9,  3,  3,  3,  2,
3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3, 13,  5,  3,  3,
3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
3,  3,  3,  3,  8,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,  3,
3,  3,  3,  3,  3,  3,  3,  3,  4,  3,  3,  3,  3,  3,  3,  3])
RuntimeError                              Traceback (most recent call last)
 in ()
----> 1 print(‘Epoch: %d/%d, Train acc : %0.2f, Test acc : %0.2f’ % (epoch, max_epochs, evaluation(trainloader,resnet), evaluation(testloader,resnet)) )
1 frames
 in evaluation(dataloader, model)
12     print(pred)
13     total += labels.size(0)
—> 14     correct +=(pred==labels).sum().item()
15   return 100 * correct/total
16 #preds = torch.tensor([])
/usr/local/lib/python3.6/dist-packages/torch/tensor.py in wrapped(*args, **kwargs)
26     def wrapped(*args, **kwargs):
27         try:
—> 28             return f(*args, **kwargs)
29         except TypeError:
30             return NotImplemented
RuntimeError: The size of tensor a (250) must match the size of tensor b (15) at non-singleton dimension 1
The dataset is imbalanced hence it predicts ‘3’ in most of the cases as there are more samples of class corresponding to the index ‘3’