onnxmltools
onnxmltools copied to clipboard
the axis for activation is incorrect while convert from CoreML to ONNX
Versons:
coreml : 5.1 onnx : 1.8.1 onnxmltools : 1.10.0 onnxruntime : 1.7.0
error while inference by onnxruntime:
Non-zero status code returned while running PRelu node. Name:'activation' Status Message: /Users/runner/work/1/s/onnxruntime/core/providers/cpu/math/element_wise_ops.h:479 void onnxruntime::BroadcastIterator::Init(ptrdiff_t, ptrdiff_t) axis == 1 || axis == largest was false. Attempting to broadcast an axis by a dimension other than 1. 16 by 128
reason:
the tensor shape is 1x16x128x128 after conv , but the activation used wrong channel dim ;
question:
how could i solve the problem ?
solution: the prelu can't only broadcast on channel , the prelu weight's shape should be Cx1x1 or c ,