def freeze_batch_norm_outside_bottleneck(model):
    for m in model.modules():
        if isinstance(m, _BatchNorm):
            m.eval()
    model.backbone_net.bottleneck.train()
def freeze_batch_norm_outside_bottleneck(model):
    for m in model.modules():
        if isinstance(m, _BatchNorm):
            m.eval()
    model.backbone_net.bottleneck.train()