Felipe Arrudi
Felipe Arrudi

Reputation: 43

Converting MoveNet to CoreML

I'm trying to convert MoveNet (evolution of PoseNet https://tfhub.dev/google/movenet/singlepose/thunder/4) into CoreML but I can't. It seems the .pb file doesn’t contain metadata.

I've been following this (https://coremltools.readme.io/docs/tensorflow-2#convert-a-pre-trained-model) but no success.

import tensorflow as tf
import tensorflow_hub as hub
import coremltools as ct

url = 'https://tfhub.dev/google/movenet/singlepose/thunder/4'
model = hub.KerasLayer(url, signature='serving_default', signature_outputs_as_dict=True)
input = tf.keras.layers.InputLayer(input_shape=(256, 256, 3))
kmodel = tf.keras.Sequential( [ input, model ] )
kmodel.build([1,256, 256, 3])
coreml = ct.convert(kmodel, source='tensorflow')

But it doesn't work... Any idea please? I'm using TensorFlow 2.7.0 and CoreMLTools 5.0b3. Tflite models are also available so if conversion can be made from them it would be an option.

Thank you!

Upvotes: 1

Views: 235

Answers (0)

Related Questions