onnxmltools icon indicating copy to clipboard operation
onnxmltools copied to clipboard

the axis for activation is incorrect while convert from CoreML to ONNX

Open CaichaoGitHub opened this issue 3 years ago • 1 comments

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 ?

CaichaoGitHub avatar Jan 04 '22 03:01 CaichaoGitHub

solution: the prelu can't only broadcast on channel , the prelu weight's shape should be Cx1x1 or c ,

CaichaoGitHub avatar Jan 06 '22 02:01 CaichaoGitHub