We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a76967c commit 9f51206Copy full SHA for 9f51206
segmentation_models_pytorch/base/model.py
@@ -180,11 +180,7 @@ def _set_encoder_trainable(self, mode: bool):
180
# _NormBase is the common base of classes like _InstanceNorm
181
# and _BatchNorm that track running stats
182
if isinstance(module, torch.nn.modules.batchnorm._NormBase):
183
- if mode:
184
- module.train()
185
- else:
186
- # Putting norm layers into eval mode stops running stats updates
187
- module.eval()
+ module.train(mode)
188
189
self._is_encoder_frozen = not mode
190
0 commit comments