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

converting to tflite using 'full_int8', I got a ValueError:Didn't find op for builtin opcode #100

Open jimsranol opened 4 years ago

jimsranol commented 4 years ago

ValueError: Didn't find op for builtin opcode 'LEAKY_RELU' version '2' Registration failed.

PS. I am using my own darknet model, and it successfully converted to tflite setting 'int8'.However, when I use 'full_int8', I got this error.

Sorry for my English.

Mercurise commented 4 years ago

Hi @jimsranol , I just solved it by installing the tf nightly. The reason is Leaky Relu version 2 is not yet implemented in tf 2.2.0 which is basically the latest stable release, which is supposed to be supported in 2.3.0. Therefore, please go for the nightly version. Hope it helps.

Resources: Related issue ticket in tf repo: https://github.com/tensorflow/tensorflow/issues/33397 The reason for it's not working: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/tools/versioning/runtime_version.cc#L233 Install tf-nightly via pip: https://pypi.org/project/tf-nightly/ Use it in Conda: https://docs.anaconda.com/anaconda/user-guide/tasks/tensorflow/#nightly-builds