首页 Paddle框架 帖子详情
paddle1.5 c++预测出错
收藏
快速回复
Paddle框架 问答深度学习 878 14
paddle1.5 c++预测出错
收藏
快速回复
Paddle框架 问答深度学习 878 14

   
1)PaddlePaddle版本:1.5
   2)CPU:预测若用CPU,i5-7200u,MKL=off
   4)系统环境:ubuntu16.04,Python版本3.7
-预测信息
   1)C++预测:1.5,的version.txt:
GIT COMMIT ID: a569615
WITH_MKL: OFF
WITH_MKLDNN: OFF
WITH_GPU: OFF
   2)CMake包含路径的完整命令,在qt5.13下编译的
   3)API信息 auto predictor =paddle::CreatePaddlePredictorpaddle::NativeConfig(config); 出错,且无法使用CHECK()
   4)预测库来源:官网下载
运行报错:
ERROR: unknown command line flag 'fraction_of_gpu_memory_to_use'

0
收藏
回复
全部评论(14)
时间顺序
AIStudio790966
#2 回复于2019-12

从你的信息来看,编译的预测库是没有编译gpu的,‘ fraction_of_gpu_memory_to_use’是设置gpu使用率,是这个导致的问题吗?

0
回复
AIStudio792131
#3 回复于2019-12

尝试带gpu的c++预测库后,这个问题没有了,但在执行 auto predictor =CreatePaddlePredictor(config);时程序依然崩溃,不知道什么问题。有没有完整的可以跑通的例程呀?

0
回复
AIStudio792131
#4 回复于2019-12

是gcc版本的问题,改成4.8就可以了
但CHECK函数无法使用

0
回复
AIStudio790966
#6 回复于2019-12

是gcc版本的问题,改成4.8就可以了
但CHECK函数无法使用

现在预测的时候CHECK函数报错吗?可以贴上错误信息吗?

0
回复
AIStudio792131
#7 回复于2019-12

CHECK(predictor->ZeroCopyRun());
提示显示:CHECK 未定义,无法编译通过

0
回复
AIStudio790966
#8 回复于2019-12

CHECK(predictor->ZeroCopyRun());
提示显示:CHECK 未定义,无法编译通过

你应该是使用NativePredictor,所以报错没有定义,不是说check未定义,是ZeroCopyRun未定义。ZeroCopyTensor的使用可避免预测时候准备输入以及获取输出时多余的数据copy,提高预测性能。只可用于AnalysisPredictor。
请再次参考1.5的c++预测文档:https://www.paddlepaddle.org.cn/documentation/docs/zh/1.5/advanced_usage/deploy/inference/native_infer.html

0
回复
AIStudio792131
#9 回复于2019-12

NativePredictor 使用样例正常.AnalysisPredictor 使用样例编译报错:

In file included from ../Downloads/fluid_inference/paddle/include/paddle_analysis_config.h:28:0,
from ../Downloads/fluid_inference/paddle/include/paddle_inference_api.h:29,
from ../untitled/main.cpp:3:
../Downloads/fluid_inference/paddle/include/paddle_api.h:235:43: warning: unused parameter ‘name’ [-Wunused-parameter]
virtual std::unique_ptr GetInputTensor(
^
../Downloads/fluid_inference/paddle/include/paddle_api.h:246:43: warning: unused parameter ‘name’ [-Wunused-parameter]
virtual std::unique_ptr GetOutputTensor(
^
../untitled/main.cpp: In function ‘void paddle::RunAnalysis(int, std::string)’:
../untitled/main.cpp:104:33: error: ‘CHECK’ was not declared in this scope
CHECK(predictor->ZeroCopyRun());
^
make: *** [main.o] Error 1

0
回复
AIStudio790966
#10 回复于2019-12

请问再次确认是使用1.5的预测样例加载1.5的预测库进行预测。

‘CHECK’ was not declared in this scope,这个报错应该是没有链接到glog库,你可以尝试将third_party/install/glog加入库环境变量中。

如果你没有特殊需求,建议使用1.6的预测库。

0
回复
AIStudio792131
#11 回复于2019-12
0
回复
AIStudio790966
#12 回复于2019-12

报错确实是CHECK没有找到,要不先把这个CHECK去掉,再试下,看模型预测输出是否正确。

0
回复
AIStudio790966
#13 回复于2019-12

使用1.5的预测样例加载1.5的预测库进行预测。 使用1.6的预测样例加载1.6的预测库进行预测。都有‘CHECK’ was not declared in this scope这个错误。已经加了glog库。CHECK函数起什么作用的?如果不重要能不能直接预测?

---原始邮件--- 发件人: "juncaipeng"<notifications@github.com> 发送时间: 2019年12月16日(周一) 下午3:35 收件人: "PaddlePaddle/Paddle"<Paddle@noreply.github.com>; 抄送: "ph2537089017"<2537089017@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [PaddlePaddle/Paddle] paddle1.5 c++预测出错 (#21748) 请问再次确认是使用1.5的预测样例加载1.5的预测库进行预测。 ‘CHECK’ was not declared in this scope,这个报错应该是没有链接到glog库,你可以尝试将third_party/install/glog加入库环境变量中。 如果你没有特殊需求,建议使用1.6的预测库。 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

请问问题解决了吗?

0
回复
AIStudio792131
#14 回复于2019-12
0
回复
AIStudio790966
#15 回复于2019-12

好的。不客气。

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户