PaddlePredictor的android项目测试ocr时崩溃
Created by: xiaolvtaomi
使用的PaddlePredictor的代码是在PaddleLite的2.0.0分支下生成的。 使用到的文件: 1,预测网络是ocr_optimize,另外PaddlePredictor.jar和 libpaddle_lite_jni.so 来自Paddle-lite-demo里。 2,MainActivity去掉了不用的代码,主要修改了输入和输入大小,如下
runModel(){
Tensor input = predictor.getInput(1);
input.resize(dims);
input.setData(inputBuffer);
Tensor inputTensor_init_ids = predictor.getInput(0);
float[] init_ids = new float[11];
long[] inputShape_ids = new long[]{1, 1};
inputTensor_init_ids.resize(inputShape_ids);
inputTensor_init_ids.setData(init_ids);
Tensor inputTensor_init_scores = predictor.getInput(2);
float[] init_scores = new float[11];
long[] inputShape_scores = new long[]{1, 1};
inputTensor_init_scores.resize(inputShape_scores);
inputTensor_init_scores.setData(init_scores);
}
public static Tensor setInputAndRunImageModel(String modelName, Context context) {
long[] dims = {1, 1, 100, 380};
int item_size = 1 * 100 * 380;
...
}
崩溃日志如下
2019-09-10 21:56:32.499 14945-14945/com.baidu.paddle.lite A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 14945 (idu.paddle.lite)
2019-09-10 21:56:32.536 703-703/? E/cnss-daemon: gateway ipv6 address: fe80::1
2019-09-10 21:56:32.536 703-703/? E/cnss-daemon: gateway mac address: %02x:%02x:%02x:%02x:%02x:%02x
: f0:92:b4:90:e5:e8
2019-09-10 21:56:32.537 703-703/? E/cnss-daemon: gw update message successfully sent
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: Build fingerprint: 'Nokia/TA-1003_00WW/D1C:7.1.1/NMF26F/00WW_3_310:user/release-keys'
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: Revision: '0'
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: ABI: 'arm64'
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: pid: 14945, tid: 14945, name: idu.paddle.lite >>> com.baidu.paddle.lite <<<
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: x0 0000000000000000 x1 0000000000003a61 x2 0000000000000006 x3 0000000000000008
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: x4 0000000000000063 x5 0000008000000000 x6 0000000080000000 x7 72743bff09636d74
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: x8 0000000000000083 x9 ffffffffffffffdf x10 0000000000000000 x11 0000000000000001
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: x12 ffffffffffffffff x13 00000000000000a0 x14 000000000000000c x15 2e8ba2e8ba2e8ba3
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: x16 0000007f87460ed0 x17 0000007f8740a81c x18 0000000000015180 x19 0000007f8a9e9b40
2019-09-10 21:56:32.586 15080-15080/? A/DEBUG: x20 0000000000000006 x21 0000007f8a9e9a98 x22 0000000000000002 x23 0000000000000091
2019-09-10 21:56:32.587 15080-15080/? A/DEBUG: x24 0000007f6b244580 x25 0000007f7848e1f8 x26 0000007f6afd6000 x27 0000007f7848e208
2019-09-10 21:56:32.587 15080-15080/? A/DEBUG: x28 0000007ffd9a3d18 x29 0000007ffd9a3700 x30 0000007f87407cac
2019-09-10 21:56:32.587 15080-15080/? A/DEBUG: sp 0000007ffd9a36e0 pc 0000007f8740a824 pstate 0000000060000000
2019-09-10 21:56:32.607 15080-15080/? A/DEBUG: backtrace:
2019-09-10 21:56:32.607 15080-15080/? A/DEBUG: #00 pc 000000000006b824 /system/lib64/libc.so (tgkill+8)
2019-09-10 21:56:32.607 15080-15080/? A/DEBUG: #01 pc 0000000000068ca8 /system/lib64/libc.so (pthread_kill+64)
2019-09-10 21:56:32.607 15080-15080/? A/DEBUG: #02 pc 0000000000024180 /system/lib64/libc.so (raise+24)
2019-09-10 21:56:32.607 15080-15080/? A/DEBUG: #03 pc 000000000001cbec /system/lib64/libc.so (abort+52)
2019-09-10 21:56:32.607 15080-15080/? A/DEBUG: #04 pc 000000000034c1ac /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle4lite15LogMessageFatalD1Ev+1948)
2019-09-10 21:56:32.607 15080-15080/? A/DEBUG: #05 pc 0000000000757aac /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle4lite3cpp8FindAttrERKNS1_6OpDescERKNSt6__ndk112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEE+236)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #06 pc 0000000000758d8c /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZNK6paddle4lite3cpp6OpDesc7GetAttrINSt6__ndk16vectorIlNS4_9allocatorIlEEEEEET_RKNS4_12basic_stringIcNS4_11char_traitsIcEENS6_IcEEEE+20)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #07 pc 000000000068c6c0 /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle4lite9operators14FillConstantOp10AttachImplERKNS0_3cpp6OpDescEPNS0_5ScopeE+688)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #08 pc 000000000073a024 /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle4lite6OpLite6AttachERKNS0_3cpp6OpDescEPNS0_5ScopeE+636)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #09 pc 00000000004e5910 /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle4lite7Program5BuildERKNS0_3cpp11ProgramDescE+1140)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #10 pc 000000000045de84 /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle4lite7ProgramC2ERKNS0_3cpp11ProgramDescERKNSt6__ndk110shared_ptrINS0_5ScopeEEERKNS6_6vectorINS_8lite_api5PlaceENS6_9allocatorISE_EEEE+436)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #11 pc 000000000045c9d4 /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle4lite14LightPredictor19BuildRuntimeProgramERKNS0_3cpp11ProgramDescE+92)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #12 pc 000000000045d71c /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle4lite14LightPredictor5BuildERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS_8lite_api13LiteModelTypeE+444)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #13 pc 000000000045d99c /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle4lite14LightPredictorC2ERKNSt6__ndk112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEENS_8lite_api13LiteModelTypeE+172)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #14 pc 000000000034c7e4 /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle8lite_api18LightPredictorImpl4InitERKNS0_12MobileConfigE+112)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #15 pc 000000000034cdec /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (_ZN6paddle8lite_api21CreatePaddlePredictorINS0_12MobileConfigEEENSt6__ndk110shared_ptrINS0_15PaddlePredictorEEERKT_+92)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #16 pc 0000000000345094 /data/app/com.baidu.paddle.lite-2/lib/arm64/libpaddle_lite_jni.so (Java_com_baidu_paddle_lite_PaddlePredictor_newCppPaddlePredictor__Lcom_baidu_paddle_lite_MobileConfig_2+676)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #17 pc 00000000000dbb10 /system/lib64/libart.so (art_quick_generic_jni_trampoline+144)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #18 pc 00000000000d2534 /system/lib64/libart.so (art_quick_invoke_stub+580)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #19 pc 00000000000df200 /system/lib64/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+204)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #20 pc 000000000028eefc /system/lib64/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+312)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #21 pc 0000000000287ed8 /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+592)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #22 pc 00000000005559a0 /system/lib64/libart.so (MterpInvokeDirect+388)
2019-09-10 21:56:32.608 15080-15080/? A/DEBUG: #23 pc 00000000000c5014 /system/lib64/libart.so (ExecuteMterpImpl+14484)
2019-09-10 21:56:32.919 14776-15062/? E/VasQuickUpdateEngine_Native: [2019-09-10 21:56:32][1568123792918][error ][UpdateMainThread:15062][unnamed:221]: CTaskSyncTable OnPbMsgRecv UpdateItem seq 39731 Count 0
2019-09-10 21:56:32.954 14776-15062/? E/VasQuickUpdateEngine_Native: [2019-09-10 21:56:32][1568123792953][error ][UpdateMainThread:15062][unnamed:405]: CTaskSyncTable listShouldUpdate count 0
2019-09-10 21:56:32.961 14776-14851/? E/Q.qqstory.StoryManager: load my local video count:0, [