Hi! I am also having a similar issue with my code. Testing with different batch sizes is giving me different results. I am doing it like this…
(inside my test loader code, after prediction…)
pred = pred.view(-1)
label = label.view(-1)
correct_count += (pred == label).double().sum().item()
total_count += pred.size(0)
and at the end of the loop over test loader I do this…
mean_accuracy = correct_count * 100 / total_count
I have tried so many different test sizes and found out that test accuracy is max, 96% with a test batch size of 512 and above and keeps declining with decrease in batch size until batch size 1 gives me 11% accuracy and I have a total of 10 classes, which means I could achieve this with random weights as well. I can’t figure out what I am doing wrong?