deeppavlov/core/models/tf_model.py
def load(self, exclude_scopes: tuple = ('Optimizer',)) -> None:
        """Load model parameters from self.load_path"""
        if not hasattr(self, 'sess'):
            raise RuntimeError('Your TensorFlow model {} must'
                               ' have sess attribute!'.format(self.__class__.__name__))
        path = str(self.load_path.resolve())
        # Check presence of the model files
        if tf.train.checkpoint_exists(path):
            log.info('[loading model from {}]'.format(path))
            # Exclude optimizer variables from saved variables
            var_list = self._get_saveable_variables(exclude_scopes)
            saver = tf.train.Saver(var_list)
            saver.restore(self.sess, path)
def load(self, exclude_scopes: tuple = ('Optimizer',)) -> None:
        """Load model parameters from self.load_path"""
        if not hasattr(self, 'sess'):
            raise RuntimeError('Your TensorFlow model {} must'
                               ' have sess attribute!'.format(self.__class__.__name__))
        path = str(self.load_path.resolve())
        # Check presence of the model files
        if tf.train.checkpoint_exists(path):
            log.info('[loading model from {}]'.format(path))
            # Exclude optimizer variables from saved variables
            var_list = self._get_saveable_variables(exclude_scopes)
            saver = tf.train.Saver(var_list)
            saver.restore(self.sess, path)
def load ( self , exclude_scopes : tuple = ( 'Optimizer' , ) ) -> None : if not hasattr ( self , 'sess' ) : raise RuntimeError ( 'Your TensorFlow model {} must' ' have sess attribute!' . format ( self . __class__ . __name__ ) ) path = str ( self . load_path . resolve ( ) ) # Check presence of the model files if tf . train . checkpoint_exists ( path ) : log . info ( '[loading model from {}]' . format ( path ) ) # Exclude optimizer variables from saved variables var_list = self . _get_saveable_variables ( exclude_scopes ) saver = tf . train . Saver ( var_list ) saver . restore ( self . sess , path )
Load model parameters from self.load_path
Load model parameters from self . load_path