Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
182 views
in Technique[技术] by (71.8m points)

tensorflow - Unable to install tfcoreml (specifically coremltools)

I've tried a virtualenv, changing my python type to 2.7x, and installing it manually.

However, I keep getting the error of

Could not find a version that satisfies the requirement coremltools>=0.8 (from tfcoreml) (from versions: ) No matching distribution found for coremltools>=0.8 (from tfcoreml)

When I search using pip search coremltools for the versions I only get coremltools (2.1.0) - Community Tools for CoreML and it still won't let me get that version.

I need help. Can somebody either tell me what I am doing wrong or walk me step-by-step of how I can install this properly?

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Just worked my way through the same error, in which coremltools==0.8 showed up as a dependency for turicreate.

The problem is that for coremltools >= 6.2, the versions pip can see are pre-built and are only available for Mac OSX >= 10.12 and Linux.

(I'm running Mac OSX 10.11, and I suspect the error is Apple's way of trying to encourage an upgrade.)

I was able to build and install coremltools from source by downloading the appropriate release from https://github.com/apple/coremltools/releases and following its README.

In particular, this meant:

  • Manually install dependencies:

    pip install numpy>=1.10
    pip install protobuf>=3.1
    
  • I did not have the command cmake, so I downloaded it from https://cmake.org. Inside the GUI were directions for installing its symlinks into /usr/local/bin:

    sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
    
  • From the coremltools source directory, run:

    cmake . -DPYTHON=$(which python) -DPYTHON_CONFIG=$(which python-config)
    make
    

    and

    python setup.up install
    

Pip could then see coremltools and it carried on with installing turicreate.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...