PINTO0309 / tflite2tensorflow

Generate saved_model, tfjs, tf-trt, EdgeTPU, CoreML, quantized tflite, ONNX, OpenVINO, Myriad Inference Engine blob and .pb from .tflite. Support for building environments with Docker. It is possible to directly access the host PC GUI and the camera to verify the operation. NVIDIA GPU (dGPU) support. Intel iHD GPU (iGPU) support. Supports inverse quantization of INT8 quantization model.
https://qiita.com/PINTO
MIT License
258 stars 38 forks source link

CoreML conversions of face_landmark_with_attention.tflite fails #32

Closed hovnatan closed 1 year ago

hovnatan commented 2 years ago

Issue Type

Bug

OS

Mac OS

OS architecture

aarch64

Programming Language

Python

Framework

CoreML

Download URL for tflite file

https://github.com/google/mediapipe/blob/master/mediapipe/modules/face_landmark/face_landmark_with_attention.tflite

Convert Script

tflite2tensorflow --model_path face_landmark_with_attention.tflite --flatc_path ../flatc --schema_path ../schema.fbs --output_coreml

Description

Error's out with ValueError: axes don't match array

Relevant Log Output

CoreML convertion started
ERROR: axes don't match array

Source code for simple inference testing code

No response

PINTO0309 commented 2 years ago

https://coremltools.readme.io/docs/onnx-conversion image

Apple is not willing to do it. Therefore, conversion to coreml is not possible.

There is no motivation to deal with unmotivated manufacturers. https://github.com/PINTO0309/PINTO_model_zoo#4-2d3d-face-detection image

hovnatan commented 2 years ago

Thanks! I really need this to work on iOS. Do you have any recommendations on how to that?

PINTO0309 commented 2 years ago

This can be done by building a model with the same structure in PyTorch and transcribing the weights.