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.23k stars 1.24k forks source link

Error: Op builtin_code out of range: 127 after deploying the model in Android #450

Closed TZECHIN6 closed 2 years ago

TZECHIN6 commented 2 years ago

I have trained my own dataset in darknet, and converted it to int8.tflite format. The model can be executed in PC without issue, the detection result seems good.

When I deploy the same model into the android project, the app crashed and exited once I open the camera. The error message is stated in below: _Caused by: Java.lang.IllegalArgumentException: Internal error: Cannot create interpreter: Op builtincode out of range: 127. Are you using old TFLite binary with newer model? Registration failed.

I have quick google this error, but so far cannot fix it. Most of the answer was telling that to use same version of TFlite and convert version, I am not sure what the exact "versioning" refer to. In this repo, tensorflow2.3.0rc0 is pre requested, would this be a problem I might use a newer version of TF?

TZECHIN6 commented 2 years ago

To anyone who might counter this issue (not exactly code 127), please try to reconvert the .weight to .tflite by using the suggested version of tensorflow2.3.0rc0, a docker image can be pull from tensorflow docker page. This solved the issue.

Niklas9401 commented 1 year ago

I am not able to download tensorflow2.3.0rc0, also from docker. I really want to use my model on android 😥