coremltools (Recommended approach)
For converting TensorFlow models to CoreML format, the recommended approach is to use TensorFlow converter available through new unified conversion API, introduced incoremltools 4.0
python package.
Please read the coremltools documentation on Tensorflow conversion for example usage.
To install coremltools package, please follow these instructions in the coremltools documentation.
tfcoreml
package is no longer maintained.
Conversion API tfcoreml.convert
should only be used if all of the following conditions are met:
- Primary deployment target is
iOS 12
or earlier. - Source model is a TensorFlow 1
graph_def
object serialized as frozen protobuf format (".pb")
To install tfcoreml
, please run:
pip install --upgrade tfcoreml
Please read this usage section which illustrates how to convert models using tfcoreml
.
For access to new features, bug fixes, community support and requests, please use coremltools github repository.