Tensorflow对象检测API索引超出界限

时间:2017-12-26 09:55:06

标签: android tensorflow object-detection

运行Android TF Detect Demo并使用我重新训练的3类ssd_mobilenet_v1_coco模型时,我的TF检测Demo崩溃,给出 IndexOutOfBoundException ,这是

  

12-26 17:53:13.931 22429-25212 / org.tensorflow.demo E / AndroidRuntime:FATAL EXCEPTION:推理                                                                        处理:org.tensorflow.demo,PID:22429                                                                        java.lang.ArrayIndexOutOfBoundsException:length = 3;索引= 3                                                                            at java.util.Vector.arrayIndexOutOfBoundsException(Vector.java:907)                                                                            在java.util.Vector.elementAt(Vector.java:328)                                                                            在java.util.Vector.get(Vector.java:442)                                                                            at org.tensorflow.demo.TensorFlowObjectDetectionAPIModel.recognizeImage(TensorFlowObjectDetectionAPIModel.java:194)                                                                            at org.tensorflow.demo.DetectorActivity $ 3.run(DetectorActivity.java:289)                                                                            在android.os.Handler.handleCallback(Handler.java:739)                                                                            在android.os.Handler.dispatchMessage(Handler.java:95)                                                                            在android.os.Looper.loop(Looper.java:148)                                                                            在android.os.HandlerThread.run(HandlerThread.java:61)

来自

beans = {
    userDetailsService(Your_service_name)
}

1 个答案:

答案 0 :(得分:1)

添加“???”解决我的Label文件中的字符串,似乎应用程序遵循第一个ID为1的pbtxt格式。