You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the YOLOv5 issues and found no similar bug report.
YOLOv5 Component
No response
Bug
I'm coding yolov5 tflite on android studio, the code is working fine on previous version on yolov5 (befor v6). Now when I use the new trend network and convert it to tflite I get this error
i export with this python export.py --weights best_n.pt --include tflite --img 380
ava.lang.IllegalArgumentException: Cannot copy to a TensorFlowLite tensor (serving_default_input_1:0) with 1769472 bytes from a Java Buffer with 1732800 bytes.
at org.tensorflow.lite.Tensor.throwIfSrcShapeIsIncompatible(Tensor.java:447)
at org.tensorflow.lite.Tensor.setTo(Tensor.java:189)
at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:200)
at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:374)
at com.android.animal_cam_alert.tflite.YoloV5Classifier.recognizeImage(YoloV5Classifier.java:392)
at com.android.animal_cam_alert.DetectorActivity$2.run(DetectorActivity.java:254)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
Environment
No response
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?
Yes I'd like to help by submitting a PR!
The text was updated successfully, but these errors were encountered:
@totoadel TFLite export works correctly, I'm unable to reproduce any issues using your command:
I am sorry it works well, the problem was with the image size , in export command enter the img size as 380 but the exported size is 384, i check it with from the site netron.app
@totoadel YOLOv5 input shapes must meet constraints of 32 pixel multiples for P5 models like YOLOv5s and 64 multiples for P6 models like YOLOv5s6.
This actually solves the issue. When training the model, its best to train with image size which is divisible by 32 and 64. The app kept crashing but then I noticed the image size not divisible by 32 and 64. Retrained it and now it isn't crashing.
Search before asking
YOLOv5 Component
No response
Bug
I'm coding yolov5 tflite on android studio, the code is working fine on previous version on yolov5 (befor v6). Now when I use the new trend network and convert it to tflite I get this error
i export with this
python export.py --weights best_n.pt --include tflite --img 380
Environment
No response
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: