facebookresearch / unbiased-teacher-v2

PyTorch code for CVPR 2022 paper Unbiased Teacher v2 Semi-supervised Object Detection for Anchor-free and Anchor-based Detectors
MIT License
90 stars 19 forks source link

Eval mode of the teacher model #8

Open 4-0-4-notfound opened 1 year ago

4-0-4-notfound commented 1 year ago

As stated in https://github.com/facebookresearch/unbiased-teacher-v2/blob/main/ubteacher/engine/trainer.py#L226

# generate the pseudo-label using teacher model
# note that we do not convert to eval mode, as 1) there is no gradient computed in
# teacher model and 2) batch norm layers are not updated as well

However, the teacher model is set to eval mode in https://github.com/facebookresearch/unbiased-teacher-v2/blob/main/ubteacher/engine/trainer.py#L55

        # create an teacher model
        model_teacher = self.build_model(cfg)
        self.model_teacher = model_teacher
        self.model_teacher.eval()

I want to know if there is any difference between the teacher model to set eval mode or not.