未验证 提交 2b793cd8 编写于 作者: G Guanghua Yu 提交者: GitHub

fix deploy/python/infer.py invaild symbol (#616)

上级 61f1366f
...@@ -306,16 +306,16 @@ def load_predictor(model_dir, ...@@ -306,16 +306,16 @@ def load_predictor(model_dir,
batch_size=1, batch_size=1,
use_gpu=False, use_gpu=False,
min_subgraph_size=3): min_subgraph_size=3):
"""set AnalysisConfiggenerate AnalysisPredictor """set AnalysisConfig, generate AnalysisPredictor
Args: Args:
model_dir (str): root path of __model__ and __params__ model_dir (str): root path of __model__ and __params__
use_gpu (bool): whether use gpu use_gpu (bool): whether use gpu
Returns: Returns:
predictor (PaddlePredictor): AnalysisPredictor predictor (PaddlePredictor): AnalysisPredictor
Raises: Raises:
ValueError: predict by TensorRT need use_gpu == True ValueError: predict by TensorRT need use_gpu == True.
""" """
if not use_gpu and run_mode == 'fluid': if not use_gpu and not run_mode == 'fluid':
raise ValueError( raise ValueError(
"Predict by TensorRT mode: {}, expect use_gpu==True, but use_gpu == {}" "Predict by TensorRT mode: {}, expect use_gpu==True, but use_gpu == {}"
.format(run_mode, use_gpu)) .format(run_mode, use_gpu))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册