-
Notifications
You must be signed in to change notification settings - Fork 74.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TFLite Android ArrayIndex outofBound Exception length=40, index=-7 #22278
Comments
The android demo app was made for one specific case this issue comment the last part of the last comment may solve your issue, you don't have to switch branch or anything, just do boundary checks like he did. |
Closing due to inactivity and since this is answered above. |
ERROR : W/System.err: java.lang.ArrayIndexOutOfBoundsException: length=10; index=-2147483648 Even I am facing the same issue could you brief on the solution? |
I am having similar issues when using custom trained models converted by https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_on_mobile_tensorflowlite.md but don't see the problem with default models automatically downloaded. |
I have it too.does not any one help us? |
I suggest you refer to #22106 #22106 (comment) for solution. |
@patrick-ucr Have you resolve this ? |
@DeepakSridhar @HaFred I am facing the same issue . If there is any legitimate solution found until now ,Please forward . |
Describe the problem
Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.
I converted mobilenet_v2_ssd trained using my data to tflite following the instructions in the blog post:
https://medium.com/tensorflow/training-and-serving-a-realtime-mobile-object-detector-in-30-minutes-with-cloud-tpus-b78971cf1193
I did not quantize the model since I didn't train it using quantized training. To run on mobile I set the
IS_QUANTIZED variable in Detector.Activity to false. When I run the app, i get the error
java.lang.ArrayIndexOutOfBoundsException: length=40; index=-8
at java.util.Vector.elementAt(Vector.java:326)
at java.util.Vector.get(Vector.java:442)
at org.tensorflow.demo.TFLiteObjectDetectionAPIModel.recognizeImage(TFLiteObjectDetectionAPIModel.java:214)
I thought the issue is due to the length of the output vector. So I changed the NUM_DETECTIONS in TFLiteObjectDetectionAPIModel.java to 40, then I get another error saying
Cannot copy between a TensorFlowLite tensor with shape [1, 10] and a Java object with shape [1, 40].
Is the length of output vector fixed? Please help me with the issue.Thanks!
The text was updated successfully, but these errors were encountered: