Esempio n. 1
0
    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)
Esempio n. 2
0
 def _init_modules(self):
     for i, m in enumerate(self.children()):
         # Fix to conv3
         if i < 10:
             freeze_params(m)
Esempio n. 3
0
def freeze_bn(m):
    classname = m.__class__.__name__
    if classname.find('BatchNorm') != -1:
        m.eval()
        freeze_params(m)
Esempio n. 4
0
 def _init_modules(self):
     # Fix conv1
     freeze_params(self.conv1)