Tool to convert models defined in Tensorflow to the Core ML format.
To get the latest version of tfcoreml
from PyPI:
pip install --upgrade tfcoreml
pip install --upgrade coremltools # tfcoreml depends on the coremltools package
For the latest changes please see the release notes.
Please see the Tensorflow conversion section in the Neural network guide on how to use the converter.
There are several notebook examples as well for reference.
There are scripts in the utils/
directory for visualizing and writing out a text summary of a given frozen TensorFlow graph.
This could be useful in determining the input/output names and shapes.
Another useful tool for visualizing frozen TensorFlow graphs is Netron.
- tensorflow >= 1.5.0
- coremltools >= 3.1
To get the latest version of the converter, clone this repository and install from source:
git clone https://github.com/tf-coreml/tf-coreml.git
cd tf-coreml
To install as a package with pip
, either run (at the root directory):
pip install -e .
or run:
python setup.py bdist_wheel
This will generate a pip
installable wheel inside the dist/
directory.
pip install --upgrade tfcoreml
In order to run unit tests, you need pytest
.
pip install pytest
To add a new unit test, add it to the tests/
folder. Make sure you
name the file with a 'test' as the prefix.
To run all unit tests, navigate to the tests/
folder and run
pytest
tfcoreml
: the tfcoreml packageexamples
: examples to use this convertertests
: unit testsutils
: general scripts for graph inspection