You would have to call model.eval() to change the behavior of some layers like nn.BatchNorm and nn.Dropout. However, if your validation works better in train mode, this might be a sign that the running estimates of your batchnorm layers are not really useful. Which batch size are you using during training and evaluation? Could you try to change the momentum of the batchnorm layers or remove them completely?