Tensorflow lite with own model

60 views
Skip to first unread message

vbpo...@gmail.com

unread,
Nov 27, 2019, 10:35:07 PM11/27/19
to TensorFlow Community Testing
I am learning about object detection of tensorflowlite. When I put my own training model into the model with parameters such as:
+ inputSize: 128 (128x128) is different from sample is 300x300
+ NUM_DETECTIONS: 2 (detects up to 2 objects) other than the sample of 10
+ and training photos are gray images
When I ran the project, the following error occurred. I have found out how to fix bugs online but not feasible. Anyone who has knowledge about this area can help me find a problem.

2019-11-28 09:11:14.488 29195-29339/com.example.driscanai E/AndroidRuntime: FATAL EXCEPTION: inference
    Process: com.example.driscanai, PID: 29195
    java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 64, 3, 7] and a Java object with shape [1, 2, 4].
        at org.tensorflow.lite.Tensor.throwIfShapeIsIncompatible(Tensor.java:342)
        at org.tensorflow.lite.Tensor.throwIfDataIsIncompatible(Tensor.java:305)
        at org.tensorflow.lite.Tensor.copyTo(Tensor.java:183)
        at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:164)
        at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:296)
        at com.example.driscanai.utils.custom.TFLiteObjectDetectionAPIModel.recognizeImage(TFLiteObjectDetectionAPIModel.java:132)
        at com.example.driscanai.screen.camera.CameraActivity$5.run(CameraActivity.java:298)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.os.HandlerThread.run(HandlerThread.java:65)
Reply all
Reply to author
Forward
0 new messages