onnx-coreml
onnx-coreml copied to clipboard
Espresso exception: "Invalid blob shape": generic_elementwise_kernel: cannot broadcast [48, 64, 32, 1, 1] and [24, 32, 32, 1, 1]
Command CoreMLModelCompile failed with a nonzero exit code
i have successfully converted the onnx model (originally in pytorch) using the following:
mlmodel = convert('NetModel.onnx', target_ios='13', custom_conversion_functions={'Upsample': _convert_upsample})
and when i tried to run this model in xcode i got the this error:
coremlc: Error: compiler error: Espresso exception: "Invalid blob shape": generic_elementwise_kernel: cannot broadcast [48, 64, 32, 1, 1] and [24, 32, 32, 1, 1] Command CoreMLModelCompile failed with a nonzero exit code
mostly this happened in upsampling conversion.
@bhushan23 I have faced with the similar issue. Is there any workaround for it?
@bhushan23 I have faced with the similar issue. Is there any workaround for it?
this issue is from upsample. the output shape of upsample layer is [48, 64, 32, 1, 1] and the input shape of the next layer is [24, 32, 32, 1, 1], so different shapes and they should be same. Workaround for this is you need to specify the scales for each upsample layer. you may know the upsample scale of your models by looking at the input shape of the upsample layer and the input shape of the next layer and estimate the scale.
I did not specify any custom_concersion_function, but still got this error.
Just wondering any update?