PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
43.92k stars 7.8k forks source link

安卓版本的demo 替换模型 识别报错 #10753

Closed smartisanyyh closed 5 months ago

smartisanyyh commented 1 year ago

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no): no

请尽量不要包含图片在问题中/Please try to not include the image in the issue.

demo 地址 https://github.com/PaddlePaddle/PaddleOCR/tree/release/2.7/deploy/android_demo

怎么才可以把这个 demo 里的模型换成英文数字模型呀,我下载了 https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_rec_slim_infer.nb 然后替换掉项目中的 nb,会报错 [F 8/25 15:21:16.458 ...ddle-Lite/lite/kernels/arm/[fc_compute.cc:103](http://fc_compute.cc:103/) ReInitWhenNeeded] Check failed: (k_ == w_dims[0]): 720!==120 应该是图片尺寸不合适导致的,但是我也没设置过图片的尺寸呀...不知道怎么玩.. 是不是我下载的模型的版本不对呀.有没有大佬帮忙解答一下,完全不懂图片识别这块,教程感觉也不是很完整,这个demo好像是去年的了,不知道是不是模型有更新,但是demo这边没有更新导致的

szaboz commented 1 year ago

Similar problem here. If I update the detection model, no problem at all, everything goes fine. However, if I update the recognition model, immediately after it found the first box and tries to recognize the characters, the application crashes. With earlier models, everything went fine. PaddleLite Version is 2.10

The crash log from logcat is the following:

3 17315-20422 libc++abi com...le.lite.demo.object_detection E terminating with uncaught exception of type std::bad_alloc: std::bad_alloc 2023-08-31 12:06:21.325 17315-20422 libc com...le.lite.demo.object_detection A Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20422 (GLThread 314481), pid 17315 (bject_detection) 2023-08-31 12:06:21.405 21023-21023 DEBUG pid-21023 A pid: 17315, tid: 20422, name: GLThread 314481 >>> com.baidu.paddle.lite.demo.object_detection <<< 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #01 pc 000000000009ce88 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libc++_shared.so (BuildId: 31abebc1b564add54fe43b52ce69acac326be4fe) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #02 pc 000000000009d07c /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libc++_shared.so (BuildId: 31abebc1b564add54fe43b52ce69acac326be4fe) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #03 pc 00000000000aead0 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libc++_shared.so (BuildId: 31abebc1b564add54fe43b52ce69acac326be4fe) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #04 pc 00000000000ae0fc /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libc++_shared.so (BuildId: 31abebc1b564add54fe43b52ce69acac326be4fe) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #05 pc 00000000000ae058 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libc++_shared.so (__cxa_throw+112) (BuildId: 31abebc1b564add54fe43b52ce69acac326be4fe) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #06 pc 0000000000092354 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libc++_shared.so (operator new(unsigned long)+96) (BuildId: 31abebc1b564add54fe43b52ce69acac326be4fe) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #07 pc 000000000009b1b8 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #08 pc 000000000009b194 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #09 pc 000000000009ad90 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #10 pc 00000000000b7834 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #11 pc 00000000000b76b4 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #12 pc 00000000000b7588 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #13 pc 00000000000b73d4 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #14 pc 00000000000b727c /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #15 pc 00000000000b74cc /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #16 pc 00000000000a0108 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #17 pc 000000000009a584 /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/lib/arm64/libNative.so (Java_com_baidu_paddle_lite_demo_ppocr_1demo_Native_nativeProcess+184) (BuildId: 19d4b19fa147e8c65f90455f89c9110e74f82ad9) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #25 pc 00000000001adc36 [anon:dalvik-classes.dex extracted in memory from /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/base.apk] (com.baidu.paddle.lite.demo.ppocr_demo.Native.process+30) 2023-08-31 12:06:21.583 21023-21023 DEBUG pid-21023 A #28 pc 00000000001ad68e [anon:dalvik-classes.dex extracted in memory from /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/base.apk] (com.baidu.paddle.lite.demo.ppocr_demo.MainActivity.onTextureChanged+86) 2023-08-31 12:06:21.584 21023-21023 DEBUG pid-21023 A #31 pc 00000000001ac40c [anon:dalvik-classes.dex extracted in memory from /data/app/~~nmR3rM1dZ7FjDAU5ALewYw==/com.baidu.paddle.lite.demo.object_detection-aoWn0tVAVVNRnTESXPuyQQ==/base.apk] (com.baidu.paddle.lite.demo.common.CameraSurfaceView.onDrawFrame+308) ---------------------------- PROCESS ENDED (17315) for package com.baidu.paddle.lite.demo.object_detection ----------------------------

chenhao86 commented 1 year ago

i have same problem.

chenhao86 commented 1 year ago

我把android 更新为 paddle-lite了。

NaumanHSA commented 12 months ago

Solved it by using Paddlelite 2.10 for model conversions (same version used in the demo on Android side)