pyanomaly/core/engine/abstract/base_engine.py
def load_pretrain(self):
        """Load the pretrain model.
        Using this method to load the pretrain model or checkpoint. 
        This method only loads the model file, not loads optimizer and etc.

        Args:
            None
        Returns:
            None
        
        """
        model_path = self.config.MODEL.pretrain_model

        if  model_path is '':
            logger.info('=>Not have the pre-train model! Training from the scratch')
        else:
            logger.info(f'=>Loading the model in {model_path}')
            pretrain_model = torch.load(model_path)
            if 'epoch' in pretrain_model.keys():
                logger.info('(|_|) ==> Use the check point file')
                # self.model.load_state_dict(pretrain_model['model_state_dict'])
                # model_file = pretrain_model['model_state_dict']
                self._load_file(self.model.keys(), pretrain_model)
            else:
                logger.info('(+_+) ==> Use the model file')
                # self.model.load_state_dict(pretrain_model['state_dict'])
                # model_file = pretrain_model['state_dict']
                self._load_file(self.model.keys(), pretrain_model)
Load the pretrain model.
        Using this method to load the pretrain model or checkpoint. 
        This method only loads the model file, not loads optimizer and etc.

        Args:
            None
        Returns:
            None
        
        
Load the pretrain model.
Using this method to load the pretrain model or checkpoint.
This method only loads the model file, not loads optimizer and etc.

None
Returns:
None
Load the pretrain model . Using this method to load the pretrain model or checkpoint . This method only loads the model file not loads optimizer and etc . None Returns : None
def load_pretrain(self):
        model_path = self.config.MODEL.pretrain_model
        if  model_path is '':
            logger.info('=>Not have the pre-train model! Training from the scratch')
        else:
            logger.info(f'=>Loading the model in {model_path}')
            pretrain_model = torch.load(model_path)
            if 'epoch' in pretrain_model.keys():
                logger.info('(|_|) ==> Use the check point file')
                self._load_file(self.model.keys(), pretrain_model)
            else:
                logger.info('(+_+) ==> Use the model file')
                self._load_file(self.model.keys(), pretrain_model)
def load_pretrain ( self ) : model_path = self . config . MODEL . pretrain_model if model_path is '' : logger . info ( '=>Not have the pre-train model! Training from the scratch' ) else : logger . info ( f'=>Loading the model in {model_path}' ) pretrain_model = torch . load ( model_path ) if 'epoch' in pretrain_model . keys ( ) : logger . info ( '(|_|) ==> Use the check point file' ) self . _load_file ( self . model . keys ( ) , pretrain_model ) else : logger . info ( '(+_+) ==> Use the model file' ) self . _load_file ( self . model . keys ( ) , pretrain_model )
Load the pretrain model.
Load the pretrain model .
"""Load the pretrain model.
        Using this method to load the pretrain model or checkpoint. 
        This method only loads the model file, not loads optimizer and etc.

        Args:
            None
        Returns:
            None
        
        """ # self.model.load_state_dict(pretrain_model['model_state_dict'])
 # model_file = pretrain_model['model_state_dict']
 # self.model.load_state_dict(pretrain_model['state_dict'])
 # model_file = pretrain_model['state_dict']

self