Closed abumubaarak closed 5 years ago
Hi @realDeve
I've not seen the code but from the error message, I can read that you are trying to use the raw ByteBuffer for your detection.
Try to change it over to a flat buffer. I have some demo code that describes this.
Look at line 27 to 32 at
Hope this helps.
Best regards Daniel
Thanks, I have solved the issue days ago... I really appreciate your help :)
2019-11-18 09:42:02.704 8365-8365/org.tensorflow.lite.examples.detection E/tensorflow: CameraActivity: Exception! java.lang.RuntimeException: java.lang.IllegalArgumentException: ByteBuffer is not a valid flatbuffer model at org.tensorflow.lite.examples.detection.tflite.TFLiteObjectDetectionAPIModel.create(TFLiteObjectDetectionAPIModel.java:132) at org.tensorflow.lite.examples.detection.DetectorActivity.onPreviewSizeChosen(DetectorActivity.java:109) at org.tensorflow.lite.examples.detection.CameraActivity.onPreviewFrame(CameraActivity.java:200) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1181) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6524) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:451) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888) Caused by: java.lang.IllegalArgumentException: ByteBuffer is not a valid flatbuffer model at org.tensorflow.lite.NativeInterpreterWrapper.createModelWithBuffer(Native Method) at org.tensorflow.lite.NativeInterpreterWrapper.(NativeInterpreterWrapper.java:60)
at org.tensorflow.lite.Interpreter.(Interpreter.java:223)
at org.tensorflow.lite.Interpreter.(Interpreter.java:211)
at org.tensorflow.lite.examples.detection.tflite.TFLiteObjectDetectionAPIModel.create(TFLiteObjectDetectionAPIModel.java:130)
at org.tensorflow.lite.examples.detection.DetectorActivity.onPreviewSizeChosen(DetectorActivity.java:109)
at org.tensorflow.lite.examples.detection.CameraActivity.onPreviewFrame(CameraActivity.java:200)
at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1181)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6524)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:451)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:888)