[Mobile] Broadcasting Error in Sub Node with ONNX Runtime Version 1.17.3: Incompatibility with Dimension Broadcasting Rules #20672
Labels
api:Java
issues related to the Java API
platform:mobile
issues related to ONNX Runtime mobile; typically submitted using template
Describe the issue
Encountered a broadcasting error in Sub node within ONNX Runtime version 1.17.3 under Android. The error message indicates a failure in dimension broadcasting, specifically: "Attempting to broadcast an axis by a dimension other than 1. 2 by 3". The issue led to a fatal exception and was resolved by downgrading to version 1.16.3 of ONNX Runtime.
Expected Behavior:
The model should process images without errors, handling dimension broadcasting as per the model's specifications. The same model worked without errors in a previous version of ONNX Runtime.
Additional Context:
Model uses internal pre and post processing and is based on YOLOv8.
Error occurs sporadically, suggesting it might be related to specific input dimensions or internal state changes.
Here is the code:
Here is the stacktrace:
2024-05-13 12:32:25.380 24950-25106 AndroidRuntime com.sosmartlabs.momotablet E FATAL EXCEPTION: DefaultDispatcher-worker-2
Process: com.sosmartlabs.momotablet, PID: 24950
ai.onnxruntime.OrtException: Error code - ORT_RUNTIME_EXCEPTION - message: Non-zero status code returned while running Sub node. Name:'post_process_58' Status Message: /onnxruntime_src/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. 2 by 3
To reproduce
Steps to reproduce the issue:
Urgency
Not urgent, but the issue is critical as it affects the stability of our application on newer versions of ONNX Runtime.
Platform
Android
OS Version
Android 10
ONNX Runtime Installation
Released Package
Compiler Version (if 'Built from Source')
No response
Package Name (if 'Released Package')
onnxruntime-android
ONNX Runtime Version or Commit ID
1.17.3
ONNX Runtime API
Java/Kotlin
Architecture
ARM64
Execution Provider
Other / Unknown
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: