Paddle
Paddle copied to clipboard
paddle_infer.create_predictor(config) 预测报错
bug描述 Describe the Bug
环境:版本 python3.8.0 cuda10.1.105; cudnn 7.6.5 ; paddlepaddle 2.3.1 用了gpu和cpu版本; 跑的是https://github.com/PaddlePaddle/ERNIE 项目中的task有 text_generation 和text_matching, 这两个task 训练的时候都是可以正常运行的,但是infer的时候就出错了,代码段是在erniekit/controller/inference.py 中的predictor = paddle_infer.create_predictor(config) 这段代码就会出现错:不管用cpu还是gpu都会报同样的问题
其他补充信息 Additional Supplementary Information
No response
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
INFO: 08-04 16:25:25: inference.py:53 * 140495399245632 init env, build inference.... INFO: 08-04 16:25:25: inference.py:94 * 140495399245632 cpu inference.... E0804 16:25:25.154521 20984 analysis_config.cc:610] EnableMKLDNN() only works when IR optimization is enabled. E0804 16:25:25.154595 20984 analysis_config.cc:610] EnableMKLDNN() only works when IR optimization is enabled.
C++ Traceback (most recent call last):
0 paddle_infer::Predictor::Predictor(paddle::AnalysisConfig const&) 1 std::unique_ptr<paddle::PaddlePredictor, std::default_deletepaddle::PaddlePredictor > paddle::CreatePaddlePredictor<paddle::AnalysisConfig, (paddle::PaddleEngineKind)2>(paddle::AnalysisConfig const&) 2 paddle::AnalysisPredictor::Init(std::shared_ptrpaddle::framework::Scope const&, std::shared_ptrpaddle::framework::ProgramDesc const&) 3 paddle::AnalysisPredictor::PrepareProgram(std::shared_ptrpaddle::framework::ProgramDesc const&) 4 paddle::framework::NaiveExecutor::CreateVariables(paddle::framework::ProgramDesc const&, int, bool, paddle::framework::Scope*)
Error Message Summary:
FatalError: Segmentation fault is detected by the operating system.
[TimeInfo: *** Aborted at 1659601525 (unix time) try "date -d @1659601525" if you are using GNU date ***]
[SignalInfo: *** SIGSEGV (@0x0) received by PID 20984 (TID 0x7fc7a25d5740) from PID 0 ***]
Segmentation fault (core dumped)
补充环境: ubuntu 18.04
代码分支拉取的是:ernie-open-v1.0
为啥没人回复呢?
可以将config.switch_ir_optim(False) 修改为 config.switch_ir_optim(True)进行测试,https://github.com/PaddlePaddle/ERNIE/blob/94a2367ba7f0f83b48330233450ea095d8dc9382/erniekit/controller/inference.py#L71
已经更改了为 config.switch_ir_optim(True)进行测试,但是没有什么帮助,依然报之前的错误
又没回复了
在 predictor = paddle_infer.create_predictor(config) 前面加上代码
config.switch_ir_optim(False)
config.enable_use_gpu(100, 0)
not working for me, suffering from the same issue.