Reputation: 73
I tried to use coremltools to convert caffemodel to mlmodel on my Mac.
Following the " pip install -U coremltools " , i got this: " Collecting coremltools Could not find a version that satisfies the requirement coremltools (from versions: ) No matching distribution found for coremltools " enter image description here
And, my python version is "Python 2.7.10", numpy version is "numpy (1.12.1)", protobuf version is "protobuf (3.2.0)"
i used " pip search coremltools ", and got " coremltools (0.3.0) - Community Tools for CoreML ", but " pip install coremltools==0.3 " got " Could not find a version that satisfies the requirement coremltools==0.3 (from versions: ) No matching distribution found for coremltools==0.3 "
wtf ? Does anyone get this as well ?
Upvotes: 4
Views: 8816
Reputation: 11987
CoreMLTools requires Python 2.7
coremltools-0.4.0-py2.7
https://pypi.python.org/pypi/coremltools
Recommended Homebrew and Python Installation
Homebrew Install (pre-Python Installation)
The macOS default PATH is /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin. You'll want to change it so that some Homebrew installations like Python will take precedence over stock macOS binaries. To make these changes, open ~/.bash_profile.
vim ~/.bash_profile
… and add these 4 lines:
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc
Since the above directives will take effect on the next login, source the file to ensure it takes effect for the current session:
source ~/.bash_profile
Python and Virtualenvs Installations
brew install python
pip install virtualenv
mkdir -p ~/Virtualenvs
cd ~/Virtualenvs
virtualenv project_folder
cd project_folder
source bin/activate
pip install -U coremltools
Upvotes: 1
Reputation: 1356
I installed python 3.6x But i couldn't install coremltool with it. Work around it is to go for virtualenv.
If command: pip install virtualenv
doesn't work just use latest command from python 3.6x i.e. pip3 install virtualenv
.
Hopefully, it should work. Cheers
Upvotes: 0
Reputation: 2143
I was able to install it using virtualenv. Here is the details.
http://satoshi.blogs.com/ml/2017/06/installing-coremltools-on-macos.html
Upvotes: 0
Reputation: 176
Try installing coremltools in a virtualenv that runs Python 2.7. Note that it currently doesn't work with Python 3.x
Once virtualenv is installed, create a new environment that runs Python 2.7
virtualenv --python=/usr/bin/python2.7 <DIR>
Next, activate the environment
source <DIR>/bin/activate
Then proceed with installing coremltools per usual
pip install -U coremltools
Upvotes: 16
Reputation: 73
I installed python 3.6 (i think all versions >= 2.7 will cause this problem). I had convert my default python version to 2.7 , but still not work.
And i use another Mac with python version 2.7 as default, it did not appear again. and now , i installed coremltools successfully:
" Collecting coremltools Downloading coremltools-0.3.0-py2.7-none-any.whl (1.4MB) 100% |████████████████████████████████| 1.4MB 171kB/s Requirement already up-to-date: numpy>=1.6.2 in /Library/Python/2.7/site-packages (from coremltools) Requirement already up-to-date: protobuf>=3.1.0 in /Library/Python/2.7/site-packages (from coremltools) Requirement already up-to-date: six>=1.9 in /Library/Python/2.7/site-packages (from protobuf>=3.1.0->coremltools) Requirement already up-to-date: setuptools in /Library/Python/2.7/site-packages (from protobuf>=3.1.0->coremltools) Installing collected packages: coremltools Successfully installed coremltools-0.3.0 "
Upvotes: 1