无法在Android

时间:2019-09-30 21:35:59

标签: android tensorflow

我正在使用默认的ssd mobilenet v1 fpn模型进行对象检测。它在笔记本电脑上运行得很好,但是当我尝试在Android上部署tflite文件时,出现了以下错误:

  

拒绝对先前失败的类java.lang.Class进行重新初始化:java.lang.NoClassDefFoundError:无法解决以下问题:Landroid / view / View $ OnUnhandledKeyEventListener;           无效androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View,androidx.core.view.OnApplyWindowInsetsListener)(ViewCompat.java:2203)           在android.view.ViewGroup上androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor()(AppCompatDelegateImpl.java:637)           无效androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor()(AppCompatDelegateImpl.java:518)           无效androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int)(AppCompatDelegateImpl.java:466)           无效androidx.appcompat.app.AppCompatActivity.setContentView(int)(AppCompatActivity.java:140)           无效org.tensorflow.lite.examples.detection.CameraActivity.onCreate(android.os.Bundle)(CameraActivity.java:95)           无效android.app.Activity.performCreate(android.os.Bundle)(Activity.java:6984)           无效android.app.Instrumentation.callActivityOnCreate(android.app.Activity,android.os.Bundle)(Instrumentation.java:1235)           在android.app.Activity上android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread $ ActivityClientRecord,android.content.Intent)(ActivityThread.java:2783)           无效android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread $ ActivityClientRecord,android.content.Intent,java.lang.String)(ActivityThread.java:2909)           无效android.app.ActivityThread.-wrap11(android.app.ActivityThread,android.app.ActivityThread $ ActivityClientRecord,android.content.Intent,java.lang.String)(ActivityThread.java:-1)           无效android.app.ActivityThread $ H.handleMessage(android.os.Message)(ActivityThread.java:1606)           无效android.os.Handler.dispatchMessage(android.os.Message)(Handler.java:105)           无效android.os.Looper.loop()(Looper.java:164)           无效android.app.ActivityThread.main(java.lang.String [])(ActivityThread.java:6592)           在java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object,java.lang.Object [])(Method.java:-2)           无效com.android.internal.os.Zygote $ MethodAndArgsCaller.run()(Zygote.java:240)           无效com.android.internal.os.ZygoteInit.main(java.lang.String [])(ZygoteInit.java:769)       原因:java.lang.ClassNotFoundException:在路径:DexPathList [[zip文件“ /data/app/org.tensorflow.lite.examples.detection-4snPFSE9sc16tBhI7Elm9g==”中找不到类“ android.view.View $ OnUnhandledKeyEventListener” /base.apk"],nativeLibraryDirectories=[/data/app/org.tensorflow.lite.examples.detection-4snPFSE9sc16tBhI7Elm9g==/lib/arm、/system/fake-libs、/data/app/org.tensorflow.lite .examples.detection-4snPFSE9sc16tBhI7Elm9g == / base.apk!/ lib / armeabi-v7a,/ system / lib,/ system / vendor / lib]]           在java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String)(BaseDexClassLoader.java:93)           在java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String,boolean)(ClassLoader.java:379)           在java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String)(ClassLoader.java:312)           无效androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View,androidx.core.view.OnApplyWindowInsetsListener)(ViewCompat.java:2203)           在android.view.ViewGroup上androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor()(AppCompatDelegateImpl.java:637)           无效androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor()(AppCompatDelegateImpl.java:518)           无效androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int)(AppCompatDelegateImpl.java:466)           无效androidx.appcompat.app.AppCompatActivity.setContentView(int)(AppCompatActivity.java:140)           无效org.tensorflow.lite.examples.detection.CameraActivity.onCreate(android.os.Bundle)(CameraActivity.java:95)           无效android.app.Activity.performCreate(android.os.Bundle)(Activity.java:6984)           无效android.app.Instrumentation.callActivityOnCreate(android.app.Activity,android.os.Bundle)(Instrumentation.java:1235)           在android.app.Activity上android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread $ ActivityClientRecord,android.content.Intent)(ActivityThread.java:2783)           无效android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread $ ActivityClientRecord,android.content.Intent,java.lang.String)(ActivityThread.java:2909)           无效android.app.ActivityThread.-wrap11(android.app.ActivityThread,android.app.ActivityThread $ ActivityClientRecord,android.content.Intent,java.lang.String)(ActivityThread.java:-1)           无效android.app.ActivityThread $ H.handleMessage(android.os.Message)(ActivityThread.java:1606)           无效android.os.Handler.dispatchMessage(android.os.Message)(Handler.java:105)           无效android.os.Looper.loop()(Looper.java:164)           无效android.app.ActivityThread.main(java.lang.String [])(ActivityThread.java:6592)           在java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object,java.lang.Object [])(Method.java:-2)           无效com.android.internal.os.Zygote $ MethodAndArgsCaller.run()(Zygote.java:240)           无效com.android.internal.os.ZygoteInit.main(java.lang.String [])(ZygoteInit.java:769)

A / libc:致命信号6(SIGABRT),在tid 25346中的代码-6(推断)

但是当我使用ssd mobilenet v1时,该应用程序运行得很好

有人可以指导我怎么做吗?任何帮助都将很棒

1 个答案:

答案 0 :(得分:0)

在Android上部署ssd mobilenet v1 fpn存在一些问题。

请参阅TF API(https://github.com/tensorflow/models/issues/5298)中的未解决问题