MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / train

Method train

segmentation/backbones/resnet.py:676–685  ·  view source on GitHub ↗

Convert the model into training mode while keep normalization layer freezed.

(self, mode=True)

Source from the content-addressed store, hash-verified

674 return tuple(outs)
675
676 def train(self, mode=True):
677 """Convert the model into training mode while keep normalization layer
678 freezed."""
679 super(ResNet, self).train(mode)
680 self._freeze_stages()
681 if mode and self.norm_eval:
682 for m in self.modules():
683 # trick: eval have effect on BatchNorm only
684 if isinstance(m, _BatchNorm):
685 m.eval()
686
687
688@BACKBONES.register_module()

Callers

nothing calls this directly

Calls 1

_freeze_stagesMethod · 0.95

Tested by

no test coverage detected