ptrblck:

.eval()


usually, I use model.train() when training, but now I don’t wanna train the BN during the training. does it sounds right if in training I do  model.eval() and then do the following

for name ,child in (model.named_children()):
    if name.find('BatchNorm') != -1:
        for param in child.parameters():
            param.requires_grad = False
    else:
        for param in child.parameters():
            param.requires_grad = True