wics1224 / yolov3-android-tflite

这个工程实现了在android中使用tflite实现yolov3的darknet53和yolov3-tiny,我的tensorflow版本是tfnightly1.1320181224
MIT License
35 stars 16 forks source link

Yolov3 classifier showing error for Input size 416 #5

Open spaul13 opened 5 years ago

spaul13 commented 5 years ago

While changing the input size from 608 to 416 in Yolov3Classifier.java, I am getting the following error

java.lang.IllegalArgumentException: Cannot convert between a TensorFlowLite buffer with 4435968 bytes and a ByteBuffer with 2076672 bytes. at org.tensorflow.lite.Tensor.throwExceptionIfTypeIsIncompatible(Tensor.java:251) at org.tensorflow.lite.Tensor.setTo(Tensor.java:110) at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:145) at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:275) at com.amitshekhar.tflite.Classifier.RecognizeImage(Classifier.java:295) at com.amitshekhar.tflite.MainActivity$DetectThread.run(MainActivity.java:105)

I have already generated a tflite model corresponding to inputsize 416 and also changed the mOutWidth to this new int[]{13,26,52}. After this I am getting this error still java.lang.IllegalArgumentException: Cannot copy between a TensorFlowLite tensor with shape [1, 13, 13, 255] and a Java object with shape [1, 13, 13, 3, 85]

Can you please tell me what else I have to do to make this one work (for input size 416)?