tensorflow-yolov4-tflite
tensorflow-yolov4-tflite copied to clipboard
i run the android example in my device and got this error java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 2535, 4] and a Java object with shape [1, 10647, 4]
hello , i download the code and run it in android device and got the following error when i try to do detection
any idea how to solve this issue ? 2021-03-14 05:50:25.110 31245-709/org.tensorflow.lite.examples.detection E/AndroidRuntime: FATAL EXCEPTION: Thread-6 Process: org.tensorflow.lite.examples.detection, PID: 31245 java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 2535, 4] and a Java object with shape [1, 10647, 4]. at org.tensorflow.lite.Tensor.throwIfShapeIsIncompatible(Tensor.java:412) at org.tensorflow.lite.Tensor.throwIfDataIsIncompatible(Tensor.java:369) at org.tensorflow.lite.Tensor.copyTo(Tensor.java:247) at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:166) at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:314) at org.tensorflow.lite.examples.detection.tflite.YoloV4Classifier.getDetectionsForFull(YoloV4Classifier.java:390) at org.tensorflow.lite.examples.detection.tflite.YoloV4Classifier.recognizeImage(YoloV4Classifier.java:542) at org.tensorflow.lite.examples.detection.tflite.YoloV4Classifier.recognizeImage(YoloV4Classifier.java:61) at org.tensorflow.lite.examples.detection.MainActivity.lambda$null$1$MainActivity(MainActivity.java:52) at org.tensorflow.lite.examples.detection.-$$Lambda$MainActivity$OxNL7NrV0ct8jl4zEsUXaD27RnY.run(Unknown Source:4) at java.lang.Thread.run(Thread.java:919)
You might want to take a look at #301
@mcanyucel Thanks for the solution. I had the same issue but its resolved based on your reference.