系统信息 ** OS平台和发行版**:Linux Ubuntu 18.04和Windows 10 从(源或二进制)安装的TensorFlow:二进制 TensorFlow版本(使用以下命令):1.9.0 CPU Bazel版本(如果从源代码编译):0.11.1
你好,我遵循以下steps来训练我的张量流模型ssd_mobilenet_v1_coco(tf记录和环境准备工作都是使用此tutorial进行的)
所有这些操作都是在Windows 10上完成的,即使在Tensorflow Android应用程序上,该模型也能正常工作 然后,要导出为TF lite格式,我将.pb文件发送到Ubuntu dist和FLOAT命令used
当我尝试在tensorflow lite android应用程序上运行模型时,出现了我的问题,我按照here的说明添加了自定义模型,但是我的模型没有检测到任何东西。当我尝试按下降低音量按钮以“调试”推论时,应用程序崩溃了。这是我的相关Android堆栈:
03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: FATAL EXCEPTION: main 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: Process: org.tensorflow.lite.demo, PID: 30807 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke interface method 'void org.tensorflow.demo.Classifier.enableStatLogging(boolean)' on a null object reference 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at org.tensorflow.demo.DetectorActivity.onSetDebug(DetectorActivity.java:294) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at org.tensorflow.demo.CameraActivity.onKeyDown(CameraActivity.java:420) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.KeyEvent.dispatch(KeyEvent.java:2712) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.app.Activity.dispatchKeyEvent(Activity.java:3291) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at com.android.internal.policy.DecorView.dispatchKeyEvent(DecorView.java:383) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4767) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4639) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4234) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4200) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4327) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4208) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4384) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4234) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4200) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4208) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4181) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4234) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4200) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4360) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4521) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2435) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1998) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1989) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2412) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.os.MessageQueue.nativePollOnce(Native Method) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.os.MessageQueue.next(MessageQueue.java:325) 03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime: at android.os.Looper.loop(Looper.java:142) 03-09 19:22:19.311 u0_a4 3080
7 30807 E AndroidRuntime:在android.app.ActivityThread.main(ActivityThread.java:6626)03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime:在java.lang.reflect.Method .invoke(本机方法)03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime:at com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:438)03-09 19:22:19.311 u0_a4 30807 30807 E AndroidRuntime:位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:811)`