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

Method train

segmentation/backbones/hrnet.py:633–642  ·  view source on GitHub ↗

Convert the model into training mode will keeping the normalization layer freezed.

(self, mode=True)

Source from the content-addressed store, hash-verified

631 return y_list
632
633 def train(self, mode=True):
634 """Convert the model into training mode will keeping the normalization
635 layer freezed."""
636 super(HRNet, self).train(mode)
637 self._freeze_stages()
638 if mode and self.norm_eval:
639 for m in self.modules():
640 # trick: eval have effect on BatchNorm only
641 if isinstance(m, _BatchNorm):
642 m.eval()

Callers

nothing calls this directly

Calls 1

_freeze_stagesMethod · 0.95

Tested by

no test coverage detected