Never mind - coremltools only supports Keras 1.2.2. Installed it with:
sudo pip install keras==1.2.2
And seems to work now. Bummer though because the model I wanted to convert is Keras 2...
keras 1.2.2 is already installed but I still get the same error:
$ python Python 3.5.2 | packaged by conda-forge | (default, Jan 20 2017, 20:58:31) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import keras Using TensorFlow backend. >>> print(keras.__version__) 1.2.2 pip install -U coremltools Collecting coremltools Could not find a version that satisfies the requirement coremltools (from versions: ) No matching distribution found for coremltools
Any ideas how to solve that?
I have the same problem - trying to convert a Keras 2 model to coremltools.
Does anyone know if this has been resolved, or ... is there a tool I can use to convert a Keras 2 model to 1.2.2?
How to install coremltools at all? Command `pip install -U coremltools` described here https://pypi.python.org/pypi/coremltools produses output:
Collecting coremltools Could not find a version that satisfies the requirement coremltools (from versions: ) No matching distribution found for coremltools
I have no idea what does that mean.
The reason why you have this problem is because you need to be running Python 2.7.x to be able to install coremltools
check which Python you are running by running: python --version
if you are running Python 3.6.x for instance, you will need to create a new virtual environment with Python 2.7.x
I like "Anaconda" as the tool to manage the environments (check out https://docs.continuum.io/anaconda/install/ )
Keras 2 support is supposed to be in place, but I'm getting this error too: AttributeError: 'module' object has no attribute 'convert'
What's up? Python 2.7.13, keras 2.0.6
I rolled back to 2.0.4, just as a test, but same error...
In case anyone hits the same problem and winds up here, you need to use the Tensorflow backend (at least for now).
coremltools works with keras 2.0.4 and tensorflow 1.1.1
if you want to be able to use coreml, simply proceed as follow :
create a new virtualenv with python 2.7 as your default interpreter
then install keras 2.0.4, numpy, coremltools using the pip command
It should now works
let me know if you still have some problems