input_data related - Runtime error: Attempting to broadcast an axis by a dimension other than 1

#1
by Frayin - opened

Error

RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Add node. Name:'Add.4' Status Message: /Users/runner/work/1/s/onnxruntime/core/providers/cpu/math/element_wise_ops.h:540 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. 19 by 20

Code to reproduce

det_session = InferenceSession(
    det_model_path, providers=["CPUExecutionProvider"]
)
input_name = det_session.get_inputs()[0].name

img = np.asarray(example_img, dtype=np.float32) # (300, 300, 3)
transposed = img.transpose(2, 0, 1)
transposed = np.expand_dims(transposed, axis=0) # (1, 3, 300, 300)
det_session.run(None, {input_name: transposed})

Questions

Could you provide a sample input_data that could work with your exported onnx? Thanks!

Sign up or log in to comment