pyanomaly/core/engine/abstract/base_engine.py
def fine_tune(self):
        """Set the fine-tuning layers
        This method will set the not fine-tuning layers freezon and the fine-tuning layers activate.

        """
        # need to improve
        layer_list = self.config.TRAIN.finetune.layer_list
        logger.info('=> Freeze layers except start with:{}'.format(layer_list))
        for n, p in self.model.named_parameters():
            parts = n.split('.')
            # consider the data parallel situation
            if parts[0] == 'module':
                if parts[1] not in layer_list:
                    p.requires_grad = False
                if p.requires_grad:
                    print(n)
            else:
                if parts[0] not in layer_list:
                    p.requires_grad = False
                if p.requires_grad:
                    print(n)
        self.logger.info('Finish Setting freeze layers')
Set the fine-tuning layers
        This method will set the not fine-tuning layers freezon and the fine-tuning layers activate.

        
Set the fine-tuning layers
This method will set the not fine-tuning layers freezon and the fine-tuning layers activate.
Set the fine - tuning layers This method will set the not fine - tuning layers freezon and the fine - tuning layers activate .
def fine_tune(self):
        layer_list = self.config.TRAIN.finetune.layer_list
        logger.info('=> Freeze layers except start with:{}'.format(layer_list))
        for n, p in self.model.named_parameters():
            parts = n.split('.')
            if parts[0] == 'module':
                if parts[1] not in layer_list:
                    p.requires_grad = False
                if p.requires_grad:
                    print(n)
            else:
                if parts[0] not in layer_list:
                    p.requires_grad = False
                if p.requires_grad:
                    print(n)
        self.logger.info('Finish Setting freeze layers')
def fine_tune ( self ) : layer_list = self . config . TRAIN . finetune . layer_list logger . info ( '=> Freeze layers except start with:{}' . format ( layer_list ) ) for n , p in self . model . named_parameters ( ) : parts = n . split ( '.' ) if parts [ 0 ] == 'module' : if parts [ 1 ] not in layer_list : p . requires_grad = False if p . requires_grad : print ( n ) else : if parts [ 0 ] not in layer_list : p . requires_grad = False if p . requires_grad : print ( n ) self . logger . info ( 'Finish Setting freeze layers' )
Set the fine-tuning layers
This method will set the not fine-tuning layers freezon and the fine-tuning layers activate.
Set the fine - tuning layers This method will set the not fine - tuning layers freezon and the fine - tuning layers activate .
"""Set the fine-tuning layers
        This method will set the not fine-tuning layers freezon and the fine-tuning layers activate.

        """ # need to improve
 # consider the data parallel situation

self