coremltools: Wrong numpy range in setup.py

🐞Describe the bug

The setup.py for coremltools specifies the numpy dependency range as 'numpy >= 1.14.5'. However using any version before then 1.16.0 causes a segmentation fault. Any version >= to 1.16.0 works.

It would be nice to support versions before 1.16.0. That version is less than a year old. However at the very least the specified dependency ranges should be accurate.

Trace

No trace displayed. Only output is Segmentation fault: 11

To Reproduce

In a fresh/new Conda environment, run: pip install Pillow coremltools==3.0b6 numpy==1.15.4

Download the MNIST Model.

Execute the following code:

import coremltools
from PIL import Image
import numpy as np

data = np.empty((28,28), dtype=np.uint8)
input_image = Image.fromarray(data)

model = coremltools.models.MLModel('./Downloads/MNISTClassifier.mlmodel')
print(model.predict({'image': input_image}))

This give a segmentation fault.

If you then run pip install numpy==1.16.0, then the above code works.

System environment (please complete the following information):

  • coremltools version (e.g., 3.0b5): 3.0b6
  • OS (e.g., MacOS, Linux): MacOS
  • macOS version (if applicable): 10.14.6
  • XCode version (if applicable): Not using
  • How you install python (anaconda, virtualenv, system): anaconda
  • python version (e.g. 3.7): 3.6

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 17

Commits related to this issue

Most upvoted comments

Installing the oldest version of numpy we want to support, before running cmake and make, solves this issue.

Oh! Thanks for letting me know this. I have upgraded the system and it is completed now.

I installed the codemltool using pip not through source but I came across different error messege :

[ 92%] Building CXX object CMakeFiles/caffeconverter.dir/deps/caffe/src/caffe/proto/caffe.pb.cc.o
[ 92%] Building CXX object CMakeFiles/caffeconverter.dir/deps/caffe/src/caffe/util/upgrade_proto.cpp.o
[ 93%] Linking CXX shared library libcaffeconverter.dylib
ld: file not found: /Users/miniconda3/envs/apple-dev/lib/arc/libarclite_macosx.a
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libcaffeconverter.dylib] Error 1
make[1]: *** [CMakeFiles/caffeconverter.dir/all] Error 2
make: *** [all] Error 2

Can you please help me to resolve this? Thanks!