onnx / tutorials

Tutorials for creating and using ONNX models
Apache License 2.0
3.36k stars 629 forks source link

Segmentation fault: 11 when running onnx_to_coreml.py #76

Open AnkitPurohit01 opened 6 years ago

AnkitPurohit01 commented 6 years ago

Hi, I am trying ONNXLive Tutorial. When I try to convert the ONNX models to CoreML models by running onnx_to_coreml.py script, I get a segmentation fault : 11 error.

Environment I used : macOS high sierra + pyhon 2.7

I also tried anaconda python 3.6 but still same error.

Following is the script I am trying to run :

import sys
from onnx import onnx_pb
from onnx_coreml import convert

model_in = sys.argv[1]
model_out = sys.argv[2]

model_file = open(model_in, 'rb')
model_proto = onnx_pb.ModelProto()
model_proto.ParseFromString(model_file.read())
coreml_model = convert(model_proto, image_input_names=['0'], image_output_names=['186'])
coreml_model.save(model_out)

Please suggest me a solution. Thank you so much in advance.

houseroad commented 6 years ago

@smessmer could you take a look?

johnwayne1995 commented 5 years ago

I have the same issue.

raccoon246 commented 5 years ago

I have the same issue.

drogen120 commented 5 years ago

I have the same issue.

Hugstar commented 5 years ago

I've had the same issue. I was able to fix this by compiling ONNX from source.

drogen120 commented 5 years ago

@Hugstar Thank you. I complied ONNX from the source but still the same error. I think the error comes from the convert function.

chinmaydas96 commented 5 years ago

Getting the same issue

Seanbakko commented 5 years ago

Has anyone converted a pytorch model to CoreML successfully? Getting the same Segmentation fault: 11 error. Anyone know how to make this work? @drogen120 @Hugstar @AnkitPurohit01

jaunruh commented 5 years ago

Like mentioned in #365 from onnx/onnx-coreml, I am also still having the issue of a segfault. I was not able to convert any onnx model to a mlmodel.

Hugstar commented 5 years ago

@Seanbakko Yes - what fixed it for me was compiling both Pytorch and ONNX from source and it solved the issue completely.

Umity commented 5 years ago

@Seanbakko Yes - what fixed it for me was compiling both Pytorch and ONNX from source and it solved the issue completely.

couldn't solve my problem. getting "Segmentation fault: 11" when trying to convert to coreml.. so annoying.