To be clear, I shuffled my data when I trained it. It is only the testing data that I modified to be unshuffled, and found that accuracy tanks. (i also used the same data for training and for testing)
1 Answer
oh i found the issue. i forgot to write
rikaclassifier.eval()
i think the issue was that my model used batchnorm, and in the unshuffled data batchnorm encountered a lot of images that are pretty much the same except for some small differences, and this made it compute different means and standard deviations than it was used to in the unshuffled data. In particular, i found that my model always predicted a number closer to 1 than 0, which im guessing is because copies of the same image have 0 standard deviation, and so dividing by standard deviation will result in a huge blow up. Setting my model to eval mode made it use precomputed mean and standard deviation across the entire dataset from the training phase




