onnx / onnxmltools

ONNXMLTools enables conversion of models to ONNX
https://onnx.ai
Apache License 2.0
1.02k stars 183 forks source link

Unsupported shape calculation for operator soundAnalysisPreprocessing: CoreML to ONNX conversion #352

Open dmytro-ostapovets opened 4 years ago

dmytro-ostapovets commented 4 years ago

Traceback (most recent call last): File "coreml_onnx.py", line 7, in model_onnx = convert_coreml(model_coreml, 7, name='OnnxModel') File "/usr/local/lib/python3.7/site-packages/winmltools/convert/main.py", line 116, in convert_coreml custom_conversion_functions, custom_shape_calculators) File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/main.py", line 18, in convert_coreml custom_conversion_functions, custom_shape_calculators) File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/coreml/convert.py", line 60, in convert topology = parse_coreml(spec, initial_types, target_opset, custom_conversion_functions, custom_shape_calculators) File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/coreml/_parse.py", line 468, in parse_coreml topology.compile() File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/common/_topology.py", line 631, in compile self._infer_all_types() File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/common/_topology.py", line 507, in _infer_all_types operator.infer_types() File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/common/_topology.py", line 109, in infer_types _registration.get_shape_calculator(self.type)(self) File "/usr/local/lib/python3.7/site-packages/onnxmltools/convert/common/_registration.py", line 68, in get_shape_calculator raise ValueError('Unsupported shape calculation for operator %s' % operator_name) ValueError: Unsupported shape calculation for operator soundAnalysisPreprocessing

Hello. I'm trying to convert CoreML model to ONNX, have this error. Model was created with CreateML -> Sound Classifier

gramsejrm commented 4 years ago

@dmytro-ostapovets Did you ever get this resolved? I'm having the same issue

arunp7 commented 3 years ago

@dmytro-ostapovets Yeah. Were you able to resolve it? @gramsejrm Did you find any other alternatives to this?

gramsejrm commented 3 years ago

@arunp7 No, we never got this to work. I ended up going with a different approach. I used a visual analysis tool to examine the CoreML model and then recreated that in tensorflow for use on Android. Funny enough, the tensorflow model has better accuracy and less false positives though I'm not sure where the differences are as they both use the same data and, as near as I can tell, the same layers.

arunp7 commented 3 years ago

@gramsejrm Glad to know tensorflow model had more accuracy in your model. Let me also try in that way. Thanks for your reply.