onnx-coreml
onnx-coreml copied to clipboard
dilated convolution does not support weight as input tensor after convert to CoreML
The Conv layer info is as below: <onnx_coreml._graph.Node object at 0x10d1ec978> attrs:{'dilations': [2, 2], 'group': 1, 'kernel_shape': [3, 3], 'pads': [0, 0, 0, 0], 'strides': [1, 1]} children:[<onnx_coreml._graph....10d1ecc18>] input_tensors:{} inputs:['189', '214_transposed'] metadata:{} name:'215' op_type:'Conv' outputs:['215'] parents:[<onnx_coreml._graph....12f766978>, <onnx_coreml._graph....10d1ec780>]
I check the CoreML tools code, the error is caused by: if (layer.input_size() != 1 && ( ((params.dilationfactor_size() > 0 && params.dilationfactor(0) > 1) || (params.dilationfactor_size() > 1 && params.dilationfactor(1) > 1)) )) { std::string err = "Convolution layer: '" + layer.name() + "' , dilated convolution does not support weight as input tensor."; return Result(ResultType::INVALID_MODEL_PARAMETERS, err); }
Is there any work around for this? Or an issue?
@edis219 can you pass weight as a constant?
@bhushan23, sure, I pass the weights as a constant into the dilated conv layer. Then this issue solved. Will the CoreML support to pass the weights as an input?
@edis219 can you pass weight as a constant?