(self, model_file_path, params_file_path)
return predictor, config, input_tensor, output_tensor
load_predictor

        initialize the inference engine

        Args:
            model_file_path: inference model path (*.pdmodel)
            model_file_path: inference parmaeter path (*.pdiparams)
        Return:
            predictor: Predictor created using Paddle Inference.
            config: Configuration of the predictor.
            input_tensor: Input tensor of the predictor.
            output_tensor: Output tensor of the predictor.
load_predictor
load_predictor
def load_predictor(self, model_file_path, params_file_path):
        """load_predictor

        initialize the inference engine

        Args:
            model_file_path: inference model path (*.pdmodel)
            model_file_path: inference parmaeter path (*.pdiparams)
        Return:
            predictor: Predictor created using Paddle Inference.
            config: Configuration of the predictor.
            input_tensor: Input tensor of the predictor.
            output_tensor: Output tensor of the predictor.
        """
        args = self.args
        config = inference.Config(model_file_path, params_file_path)
        if args.use_gpu:
            config.enable_use_gpu(1000, 0)
        else:
            config.disable_gpu()

        # enable memory optim
        config.enable_memory_optim()
        config.disable_glog_info()

        config.switch_use_feed_fetch_ops(False)
        config.switch_ir_optim(True)

        # create predictor
        predictor = inference.create_predictor(config)

        # get input and output tensor property
        input_names = predictor.get_input_names()
        input_tensor = predictor.get_input_handle(input_names[0])

        output_names = predictor.get_output_names()
        output_tensor = predictor.get_output_handle(output_names[0])

        return predictor, config, input_tensor, output_tensor
def load_predictor ( self , model_file_path , params_file_path ) : args = self . args config = inference . Config ( model_file_path , params_file_path ) if args . use_gpu : config . enable_use_gpu ( 1000 , 0 ) else : config . disable_gpu ( ) # enable memory optim config . enable_memory_optim ( ) config . disable_glog_info ( ) config . switch_use_feed_fetch_ops ( False ) config . switch_ir_optim ( True ) # create predictor predictor = inference . create_predictor ( config ) # get input and output tensor property input_names = predictor . get_input_names ( ) input_tensor = predictor . get_input_handle ( input_names [ 0 ] ) output_names = predictor . get_output_names ( ) output_tensor = predictor . get_output_handle ( output_names [ 0 ] ) return predictor , config , input_tensor , output_tensor