Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rk3588平台,ocr demo运行不了 #373

Open
itouchsky opened this issue Mar 23, 2024 · 5 comments
Open

rk3588平台,ocr demo运行不了 #373

itouchsky opened this issue Mar 23, 2024 · 5 comments
Assignees

Comments

@itouchsky
Copy link

/Paddle/Paddle-Lite-Demo/ocr/armlinux/shell/cxx/ppocr_demo# ./run.sh
[I 3/23 8: 1:40.683 ...dle/Paddle-Lite/lite/core/device_info.cc:283 get_cpu_arch] Unknow cpu arch: 3339
[I 3/23 8: 1:40.683 ...dle/Paddle-Lite/lite/core/device_info.cc:283 get_cpu_arch] Unknow cpu arch: 3339
[I 3/23 8: 1:40.683 ...dle/Paddle-Lite/lite/core/device_info.cc:283 get_cpu_arch] Unknow cpu arch: 3339
[I 3/23 8: 1:40.683 ...dle/Paddle-Lite/lite/core/device_info.cc:283 get_cpu_arch] Unknow cpu arch: 3339
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1330 Setup] ARM multiprocessors name:
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1331 Setup] ARM multiprocessors number: 8
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1333 Setup] ARM multiprocessors ID: 0, max freq: 1800, min freq: 1800, cluster ID: 1, CPU ARCH: A55
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1333 Setup] ARM multiprocessors ID: 1, max freq: 1800, min freq: 1800, cluster ID: 1, CPU ARCH: A55
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1333 Setup] ARM multiprocessors ID: 2, max freq: 1800, min freq: 1800, cluster ID: 1, CPU ARCH: A55
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1333 Setup] ARM multiprocessors ID: 3, max freq: 1800, min freq: 1800, cluster ID: 1, CPU ARCH: A55
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1333 Setup] ARM multiprocessors ID: 4, max freq: 2352, min freq: 2352, cluster ID: 0, CPU ARCH: A-1
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1333 Setup] ARM multiprocessors ID: 5, max freq: 2352, min freq: 2352, cluster ID: 0, CPU ARCH: A-1
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1333 Setup] ARM multiprocessors ID: 6, max freq: 2352, min freq: 2352, cluster ID: 0, CPU ARCH: A-1
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1333 Setup] ARM multiprocessors ID: 7, max freq: 2352, min freq: 2352, cluster ID: 0, CPU ARCH: A-1
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1339 Setup] L1 DataCache size is:
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1341 Setup] 32 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1341 Setup] 32 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1341 Setup] 32 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1341 Setup] 32 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1341 Setup] 64 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1341 Setup] 64 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1341 Setup] 64 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1341 Setup] 64 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1343 Setup] L2 Cache size is:
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1345 Setup] 128 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1345 Setup] 128 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1345 Setup] 128 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1345 Setup] 128 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1345 Setup] 512 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1345 Setup] 512 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1345 Setup] 512 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1345 Setup] 512 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1347 Setup] L3 Cache size is:
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1349 Setup] 3072 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1349 Setup] 3072 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1349 Setup] 3072 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1349 Setup] 3072 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1349 Setup] 3072 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1349 Setup] 3072 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1349 Setup] 3072 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1349 Setup] 3072 KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1351 Setup] Total memory: 16053244KB
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1352 Setup] SVE2 support: 0
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1353 Setup] SVE2 f32mm support: 0
[I 3/23 8: 1:40.684 ...dle/Paddle-Lite/lite/core/device_info.cc:1354 Setup] SVE2 i8mm support: 0
./run.sh: line 6: 600959 Segmentation fault (core dumped) ./ppocr_demo ./models/ch_ppocr_mobile_v2.0_det_slim_opt.nb ./models/ch_ppocr_mobile_v2.0_rec_slim_opt. nb ./models/ch_ppocr_mobile_v2.0_cls_slim_opt.nb ./images/test.jpg ./test_img_result.jpg ./labels/ppocr_keys_v1.txt ./config.txt

编译脚本不能运行,修改如下:
git diff build.sh
diff --git a/ocr/armlinux/shell/cxx/ppocr_demo/build.sh b/ocr/armlinux/shell/cxx/ppocr_demo/build.sh
old mode 100644
new mode 100755
index 562e7d7..6cad9ee
--- a/ocr/armlinux/shell/cxx/ppocr_demo/build.sh
+++ b/ocr/armlinux/shell/cxx/ppocr_demo/build.sh
@@ -25,9 +25,9 @@ echo "make successful!"
cd ../../
if [ ! -d "./ppocr_demo" ]; then
mkdir ppocr_demo
-fils
+fi

-cp ./src/ppocr_demo ./ppocr_demo
+cp ./src/build/ppocr_demo ./ppocr_demo

@csy0225
Copy link
Contributor

csy0225 commented Mar 23, 2024

编译脚本不能运行报的是什么错呢?我看您的log没有贴上来欸。

@csy0225
Copy link
Contributor

csy0225 commented Mar 23, 2024

看报错信息,大概率应该是库和环境不匹配,可以尝试按照我们官方文档进行编译替换 https://www.paddlepaddle.org.cn/lite/v2.12/demo_guides/verisilicon_timvx.html

@itouchsky
Copy link
Author

在编译人体姿态的demo时,demo中用到的是paddle_full_api_shared库,运行出错,错误如下:
[I 3/23 17:26:12.536 ...le-Lite/lite/core/optimizer/optimizer.cc:99 ApplyPasses] == Running pass: argument_type_display_pass
[I 3/23 17:26:12.540 ...le-Lite/lite/core/optimizer/optimizer.cc:119 ApplyPasses] == Finished running: argument_type_display_pass
[I 3/23 17:26:12.540 ...le-Lite/lite/core/optimizer/optimizer.cc:99 ApplyPasses] == Running pass: runtime_context_assign_pass
[I 3/23 17:26:12.541 ...le-Lite/lite/core/optimizer/optimizer.cc:119 ApplyPasses] == Finished running: runtime_context_assign_pass
[I 3/23 17:26:12.541 ...le-Lite/lite/core/optimizer/optimizer.cc:99 ApplyPasses] == Running pass: argument_type_display_pass
[I 3/23 17:26:12.545 ...le-Lite/lite/core/optimizer/optimizer.cc:119 ApplyPasses] == Finished running: argument_type_display_pass
[I 3/23 17:26:12.545 ...le-Lite/lite/core/optimizer/optimizer.cc:99 ApplyPasses] == Running pass: lite_inplace_fuse_pass
[I 3/23 17:26:12.551 ...le-Lite/lite/core/optimizer/optimizer.cc:119 ApplyPasses] == Finished running: lite_inplace_fuse_pass
[I 3/23 17:26:12.551 ...le-Lite/lite/core/optimizer/optimizer.cc:99 ApplyPasses] == Running pass: memory_optimize_pass
[I 3/23 17:26:12.551 ...le-Lite/lite/core/optimizer/optimizer.cc:107 ApplyPasses] - Skip memory_optimize_pass because the target or kernel does not match.
[I 3/23 17:26:12.551 ...le-Lite/lite/core/optimizer/optimizer.cc:99 ApplyPasses] == Running pass: xpu_memory_optimize_pass
[I 3/23 17:26:12.551 ...le-Lite/lite/core/optimizer/optimizer.cc:107 ApplyPasses] - Skip xpu_memory_optimize_pass because the target or kernel does not match.
[I 3/23 17:26:12.619 ...re/optimizer/mir/generate_program_pass.h:41 GenProgram] insts.size: 1
[I 3/23 17:26:12.819 ...e-Lite/lite/model_parser/model_parser.cc:537 SaveModelNaive] 2. Model is optimized and saved into ../../assets/models/PP_TinyPose_128x96_qat_dis_nopact.nb successfully
############################################2
############################################3
[I 3/23 17:26:13.105 ...r/src/driver/verisilicon_timvx/engine.cc:43 Context] properties:
[I 3/23 17:26:13.105 ...r/src/driver/verisilicon_timvx/engine.cc:53 Context] bn_fusion_max_allowed_quant_scale_deviation: 30000
[W 3/23 17:26:13.105 ...ter/nnadapter/src/runtime/compilation.cc:334 Finish] Warning: Failed to create a program, No model and cache is provided.
[W 3/23 17:26:13.105 ...le-Lite/lite/kernels/nnadapter/engine.cc:149 LoadFromCache] Warning: Build model failed(3) !
[W 3/23 17:26:13.147 ...nnadapter/nnadapter/src/runtime/model.cc:86 GetSupportedOperations] Warning: Failed to get the supported operations for device 'verisilicon_timvx', because the HAL interface 'validate_program' is not implemented!
[W 3/23 17:26:13.147 ...kernels/nnadapter/converter/converter.cc:171 Apply] Warning: Failed to get the supported operations for the selected devices, one or more of the selected devices are not supported!
[I 3/23 17:26:13.147 ...r/src/driver/verisilicon_timvx/driver.cc:70 CreateProgram] Create program for verisilicon_timvx.
[ 1] Failed to open device: No such file or directory, Try again...
[ 2] Failed to open device: No such file or directory, Try again...
[ 3] Failed to open device: No such file or directory, Try again...
[ 4] Failed to open device: No such file or directory, Try again...
[ 5] _OpenDevice(1086): FATAL: Failed to open device, errno=No such file or directory.

原码编译Paddle-lite出的库只有paddle_light_api_shared,修改为用paddle_light_api_shared库后编译出现以下错误,请帮助解答一下
-- Build files have been written to: /home/lynxi/Paddle/Paddle-Lite-Demo/pose_detection/linux/tiny_pose/build
Scanning dependencies of target pose_detection_demo
[ 50%] Building CXX object CMakeFiles/pose_detection_demo.dir/pose_detection_demo.cc.o
[100%] Linking CXX executable pose_detection_demo
/usr/bin/ld: CMakeFiles/pose_detection_demo.dir/pose_detection_demo.cc.o: in function main': pose_detection_demo.cc:(.text+0x1fc8): undefined reference to std::shared_ptrpaddle::lite_api::PaddlePredictor paddle::lite_api::CreatePaddlePredictorpaddle::lite_api::CxxConfig(paddle::lite_api::CxxConfig const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/pose_detection_demo.dir/build.make:99: pose_detection_demo] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/pose_detection_demo.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

@csy0225
Copy link
Contributor

csy0225 commented Mar 25, 2024

上面报错的原因,是因为在 Paddle-Lite demo 中,如果使用的是 paddle_full_api_shared.so ,那么创建 predictor 的时候使用的是 cxxconfig;如果使用的是 paddle_light_api_shared.so,使用的是 mobileconfig,所以才会报 cxxconfig 的错误。解决这个问题后,你还要保证一下您使用的 opt 版本和 Paddle-Lite 版本是一致的,头文件也是要对应版本的,都 check 一下。另外也可以参考一下官方文档中的 demo,那个里面都比较详细。

@csy0225
Copy link
Contributor

csy0225 commented Mar 29, 2024

另:如果是想在3588平台使用 cpu,Paddle-Lite 是支持的,但是如果是想使用 NPU,建议使用他们自己的离线工具进行部署,目前 Paddle-Lite 是不支持的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants