tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Segmentation fault: 11 when running onnx_to_coreml.py

Open AnkitPurohit01 opened this issue 6 years ago • 11 comments

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.

AnkitPurohit01 avatar Oct 09 '18 05:10 AnkitPurohit01

@smessmer could you take a look?

houseroad avatar Oct 12 '18 00:10 houseroad

I have the same issue.

johnwayne1995 avatar Oct 21 '18 14:10 johnwayne1995

I have the same issue.

raccoon246 avatar Nov 01 '18 05:11 raccoon246

I have the same issue.

drogen120 avatar Nov 27 '18 10:11 drogen120

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

Hugstar avatar Nov 27 '18 10:11 Hugstar

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

drogen120 avatar Nov 27 '18 12:11 drogen120

Getting the same issue

chinmaydas96 avatar Jan 03 '19 18:01 chinmaydas96

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

Seanbakko avatar Jan 08 '19 18:01 Seanbakko

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.

jaunruh avatar Jan 09 '19 13:01 jaunruh

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

Hugstar avatar Jan 09 '19 13:01 Hugstar

@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.

Umity avatar Feb 04 '19 13:02 Umity