Paddle-Lite在ARM Linux上运行人脸检测与口罩检测demo失败
Created by: luoyancn
问题描述:
1.选用的Paddle-Lite版本:v2.2.0 2.Paddle-Lite编译参数:
lite/tools/build.sh --arm_os=armlinux --arm_abi=armv7hf --arm_lang=gcc \
--build_extra=ON full_publish
编译正常,成功生成了需要的so文件 3.使用的人脸检测和口罩检测代码:https://github.com/PaddlePaddle/Paddle-Lite/tree/develop/lite/demo/cxx/mask_detection 4.在ARM Linux上对该demo进行编译,编译的指令如下:
g++ -Ofast -Wall -mfloat-abi=softfp -mfpu=neon-vfpv4 \
-std=c++11 -L /opt/cxx/lib/ `pkg-config --cflags --libs opencv` \
-I /opt/cxx/include/ -o mask_detection mask_detection.cc \
`pkg-config --libs opencv` -lpaddle_light_api_shared -lpthread
其中,/opt/cxx为第2步编译所生成的include和so文件。编译结果正常,成功生成mask_detection可执行文件
5.下载已经优化完成的模型pyramidbox_lite_mobile_mask,并进行解压:
wget https://paddle-inference-dist.bj.bcebos.com/mask_detection.tar.gz
tar -zxvf mask_detection.tar.gz
6.执行人脸检测和口罩检测示例程序:
./mask_detection face_detection mask_classification/ test.jpg
随后提示错误:
terminate called after throwing an instance of 'std::invalid_argument' what(): unmatched type, store as -1723342561, but want to get N6paddle4lite10TensorLiteE Aborted
简单进行了分析和调试,发现错误可能是在https://github.com/PaddlePaddle/Paddle-Lite/blob/develop/lite/demo/cxx/mask_detection/mask_detection.cc#L144发生的。
请各位进行分析。谢谢!