def _init_modules(self): assert 0 <= cfg.MOBILENET.FREEZE_AT <= 14 for i in range(cfg.RESNETS.FREEZE_AT): freeze_params(self.conv[i]) # Freeze all bn (affine) layers !!! self.apply(freeze_bn)
def _init_modules(self): for i, m in enumerate(self.children()): # Fix to conv3 if i < 10: freeze_params(m)
def freeze_bn(m): classname = m.__class__.__name__ if classname.find('BatchNorm') != -1: m.eval() freeze_params(m)
def _init_modules(self): # Fix conv1 freeze_params(self.conv1)