hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.24k stars 1.24k forks source link

Errors with converted yolov4 model on Android Studio #474

Open HripsimeS opened 1 year ago

HripsimeS commented 1 year ago

Hello. I downloaded yolov4.weights from the official https://github.com/AlexeyAB/darknet

After I used this command to save tf model for tflite converting python save_model.py --weights ./data/yolov4.weights --output ./checkpoints/yolov4-416 --input_size 416 --model yolov4 --framework tflite

And this command converts yolov4 quantize float16 python convert_tflite.py --weights ./checkpoints/yolov4-416 --output ./checkpoints/yolov4-416-fp16.tflite --quantize_mode float16

I put that model in assets folder, I modify the path in java files fpr the model and when I launch the app I got these errors

E/QT: [QT]file does not exist E/MiuiMultiWindowUtils: initFreeFormResolutionArgs failed, device is eos E/ion: ioctl c0044901 failed with code -1: Invalid argument E/AndroidRuntime: FATAL EXCEPTION: main Process: org.tensorflow.lite.examples.detection, PID: 29232 java.lang.RuntimeException: Unable to start activity ComponentInfo{org.tensorflow.lite.examples.detection/org.tensorflow.lite.examples.detection.MainActivity}: java.lang.RuntimeException: java.lang.IllegalArgumentException: Internal error: Cannot create interpreter: Op builtin_code out of range: 127. Are you using old TFLite binary with newer model? Registration failed. Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: Internal error: Cannot create interpreter: Op builtin_code out of range: 127. Are you using old TFLite binary with newer model? Registration failed. Caused by: java.lang.IllegalArgumentException: Internal error: Cannot create interpreter: Op builtin_code out of range: 127. Are you using old TFLite binary with newer model? Registration failed.

Do you know what is the issue with the converted model and how to fix it? Thank in advance!