guichristmann / edge-tpu-tiny-yolo

Run Tiny YOLO-v3 on Google's Edge TPU USB Accelerator.
MIT License
102 stars 31 forks source link

converting to tflite error #3

Closed IbrahimBond closed 4 years ago

IbrahimBond commented 4 years ago

when i try to convert keras to tflite model i get the following error:

INFO: Initialized TensorFlow Lite runtime. Traceback (most recent call last): File "keras_to_tflite_quant.py", line 40, in tflite_model = converter.convert() File "/home/bond/.local/lib/python3.6/site-packages/tensorflow/lite/python/lite.py", line 922, in convert inference_output_type) File "/home/bond/.local/lib/python3.6/site-packages/tensorflow/lite/python/lite.py", line 200, in _calibrate_quantize_model inference_output_type, allow_float) File "/home/bond/.local/lib/python3.6/site-packages/tensorflow/lite/python/optimize/calibrator.py", line 78, in calibrate_and_quantize np.dtype(output_type.as_numpy_dtype()).num, allow_float) File "/home/bond/.local/lib/python3.6/site-packages/tensorflow/lite/python/optimize/tensorflow_lite_wrap_calibration_wrapper.py", line 115, in QuantizeModel return _tensorflow_lite_wrap_calibration_wrapper.CalibrationWrapper_QuantizeModel(self, input_py_type, output_py_type, allow_float) RuntimeError: Quantization not yet supported for op: LEAKY_RELU

do you know what could be the issue ?

thanks

IbrahimBond commented 4 years ago

hi any update on this?

i have used your forked repository for conversion from darknet to keras, but i still get this when trying to convert to tflite.

thanks

bjun7176 commented 4 years ago

I am also facing the same issue.

guichristmann commented 4 years ago

As I stated in the README of the repository, there is no support for the quantization of the Leaky ReLU activation. It is not a supported operation in TF Lite quantization. You'll have to replace the Leaky with the regular ReLU function in your model.