apple / apple/coremltools

Convert SSD MobileNet V2 to CoreML

Open
#1,542 16 comments 0 reactions 0 assignees View on GitHub
question tf2.x / tf.keras
Dominant language
Python
Stars
5.4k
Forks
850
Avg merge
4d 5h
Merged PRs (30d)
10

Description

## ❓Question

I have an SSD MobileNet V2 model trained with Tensorflow Object detection API. How can I convert it to coreml?
I tried the following steps but it did not work:

- Convert checkpoints to saved model using `exporter_main_v2.py`
- Load model `model = tf.saved_model.load("path/to/model)`
- Run `coremltools.convert(model, source="tensorflow")`

I got an error:
`NotImplementedError: Expected model format: [SavedModel | [concrete_function] | tf.keras.Model | .h5], got ._UserObject object at 0x7fab1a41cd90>`

ubuntu 18
python version 3.7.6
Tensorflow version 2.8.2
coremltools version 5.2

Contributor guide

Open the contributing guide

Research direction

Start with the TensorFlow Object Detection API export step using exporter_main_v2.py, then inspect how the resulting SavedModel is passed to coremltools.convert. Reproduce the reported error with Python 3.7.6, TensorFlow 2.8.2, and coremltools 5.2; done means documenting or confirming a working conversion path for SSD MobileNet V2.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning, tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.