google / automl

Google Brain AutoML
Apache License 2.0
6.18k stars 1.45k forks source link

Exported tflite model is incompatible with MediaPipe #1211

Open Tachi107 opened 2 months ago

Tachi107 commented 2 months ago

Hi!

When exporting a model with python3 model_inspect.py --runmode=saved_model --tflite_path=model.tflite, the exported TensorFlow Lite model is incompatible with mobile libraries like MediaPipe and the TensorFlow Lite Task Library, since they require the model to have four output tensors (as described here), while the exported model is an EfficientDetNet model with only one output tensor.

If I understand correctly, the full model required by those libraries is EfficientDetModel, added in commit https://github.com/google/automl/commit/cedf982590e1d7da0e388a8ae01d3e0d6c3a8625.

Would it be possible to improve the model_inspect.py script to export the TFLite model with all the four required tensors?

Thanks!