Paddle fluid.core.create_paddle_predictor 出core Segmentation fault

92dk7w1h  于 2022-04-21  发布在  Java
关注(0)|答案(1)|浏览(310)

环境:python3.6, Linux, paddle1.8.4, paddlehub1.8.1
复现步骤:
运行文本匹配任务demo预测时,使用GPU预测,并将matching_task.predict接口参数accelerate_mode改成True时,出现core Segmentation fault 错误

[2020-09-02 10:07:32,585] [    INFO] - Try loading checkpoint from ./ckpt_ernie_pointwise_matching/ckpt.meta
[2020-09-02 10:07:32,585] [    INFO] - PaddleHub model checkpoint not found, start from scratch...
run_ernie_pointwise_matching_predict.sh: line 8: 24500 Segmentation fault      (core dumped) python -u ernie_pointwise_matching_predict.py --batch_size=1 --use_gpu=True --checkpoint_dir=${CKPT_DIR} --max_seq_len=128

经过调试发现,错误出现在运行fluid.core.create_paddle_predictor时出现上述错误。请相关同学帮忙排查下具体问题。

同时,发现将paddle版本更换为1.7.2,GPU运行predictor可以正常运行。

djmepvbi

djmepvbi1#

最小复现代码:

import paddle
import paddle.fluid as fluid

predictor_config = fluid.core.AnalysisConfig('./test')
predictor_config.disable_glog_info()
predictor_config.enable_use_gpu(100, 0)
predictor_config.switch_ir_optim(True)
predictor_config.enable_memory_optim()
print('&'*10)
predictor = fluid.core.create_paddle_predictor(predictor_config)
print('%'*10, predictor)

相关问题