-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
passing tags for use when loading TF saved_model #1024
base: main
Are you sure you want to change the base?
Conversation
|
We ned to add this to our public doc as it's part of converter API (whether in kwargs or not), with example use cases. Like @aseemw suggested, can you add a test which would serve as an example? |
Let's back to what the problem is and why When I was trying to convert MobileBERT with import coremltools as ct
mobilebert_model = ct.convert('mobilebert_squad_savedmodels/float/', source="tensorflow") I got
Nonetheless, I could not find a way to pass the I didn't try to add |
Yeah that would be great if you can add a test case (say in https://github.com/apple/coremltools/blob/master/coremltools/converters/mil/frontend/tensorflow2/test/test_v2_load.py or https://github.com/apple/coremltools/blob/master/coremltools/test/api/test_api_examples.py). I think actually, adding it as part of kwargs initially might be better, before jumping in to add it as an official argument. |
37787a8
to
74ac0ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should remove this space.
@@ -292,6 +292,43 @@ def test_convert_from_saved_model_dir(): | |||
mlmodel = ct.convert("./saved_model") | |||
mlmodel.save("./model.mlmodel") | |||
|
|||
@staticmethod | |||
def test_convert_from_two_tags_saved_model_dir(tmpdir): | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Some saved_models have more than one tag, e.g., MobileBERT SQuAD 1.1 checkpoints. Need a way to specify tag
1. add **kwargs to convert() in _converters_entry 2. remove extra space in test_api_examples.py
74ac0ee
to
6049b76
Compare
…pple#1024) * document cpu offloading method * address review comments Co-authored-by: Patrick von Platen <[email protected]> Co-authored-by: Patrick von Platen <[email protected]>
Some saved_models have more than one tag, e.g., MobileBERT SQuAD 1.1 checkpoints. Need a way to specify tag.