I have been asked to start using CoreML and convert our tensorflow ML model.
So I wanted to follow the quickstart example documentation to see how to do this.
Here are the steps I took :
- Installation steps :
1. install Conda package installer
- download Miniconda3 v3.9 package : https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-MacOSX-x86_64.pkg
- run the package installation
- create an environment shell : conda create --name coremltools-env
- creates in <user>/opt/miniconda3/envs/coremltools-env
- activate the environment : conda activate coremltools-env
- install pip for this environment : conda install pip
2. install CoreML tools in the conda environment
- pip install coremltools==5.0b5 (note this is a beta version, could not find the previous stable version)
3. install tensorflow within the conda environment
- pip install tensorflow
4. install h5py
- pip install h5py
- run the python script to load (from a distance) the tensorflow model and convert it to CoreML
I then run the python scripts as described in the documentation (except the test), and I get this error message :
RuntimeWarning: You will not be able to run predict() on this Core ML model. Underlying exception message was: Error compiling model: "Error reading protobuf spec. validator error: Model specification version field missing or corrupt.".
_warnings.warn(
Note - I have included all the text of the message.
Is this a problem with CoreML tools v5.0 beta 5 ?
Should I try a previous version of CoreML tools, if so, where can I find the correct version numbers ?