Yes, for some architectures it might not matter, but ResNet has BatchNorm layers, so it should be set to train() during training to parameterize these layers correctly, and eval() for testing to not update these on the test set.