使用Flutter做目标检测时出现库错误
Created by: KernelErr
在尝试用Flutter结合Paddle-lite做一个实时目标检测的Demo,将Paddle-lite的官方Demo封装成了一个MethodChanel,结果发现每次检测新的一帧的时候都需要进行loadModel,否则检测一帧之后就会出现错误。使用的模型是Yolov3 Tiny。
报错信息:
F/libc (16823): Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x70c2600000 in tid 17433 (Thread-8), pid 16823 (mple.realtimeod)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'HONOR/HLK-AL00/HWHLK-H:9/HONORHLK-AL00/9.1.1.165C00:user/release-keys'
Revision: '0'
ABI: 'arm64'
Happend: 'Wed Mar 18 14:36:21 2020
'
SYSVMTYPE: Maple
APPVMTYPE: Art
pid: 16823, tid: 17433, name: Thread-8 >>> com.example.realtimeod <<<
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x70c2600000
x0 00000070c24d6b80 x1 0000000000000000 x2 00000000004d6b00 x3 00000070c2600000
x4 00000070c2ad6b80 x5 0000000000000004 x6 0000000000000001 x7 0000000000000400
x8 00000070c24d6b80 x9 0000000000000180 x10 0000000000000001 x11 0000000000000009
x12 000000000000000a x13 000000000000000a x14 0000000000000007 x15 00000070b2efe2e8
x16 00000070db338ba8 x17 00000071892e02b0 x18 00000070c5e05c70 x19 00000070b2efe338
x20 0000000000000080 x21 000000000000000c x22 00000070dc9f3880 x23 000000000000000c
x24 00000070c6600040 x25 0000000000000019 x26 0000000000600000 x27 0000000000000008
x28 00000070c248eb80 x29 00000070b2efe0f0
sp 00000070b2efe080 lr 00000070db27988c pc 00000071892e03b0
backtrace:
#00 pc 000000000001e3b0 /system/lib64/libc.so (memset+256)
#01 pc 00000000000b9888 /data/app/com.example.realtimeod-Vc9i5SwY5rib1NHlrS_wog==/lib/arm64/libpaddle_lite_jni.so
Flutter信息:
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Linux, locale zh_CN.UTF-8)
• Flutter version 1.12.13+hotfix.8 at /home/li/development/flutter
• Framework revision 0b8abb4724 (5 周前), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /home/li/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-29, build-tools 29.0.3
• Java binary at: /home/li/development/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Android Studio (version 3.6)
• Android Studio at /home/li/development/android-studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build
1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.43.0)
• VS Code at /usr/share/code
• Flutter extension version 3.8.1
[✓] Connected device (1 available)
• HLK AL00 • C7Y6R19725003580 • android-arm64 • Android 9 (API 28)
• No issues found!