armnn icon indicating copy to clipboard operation
armnn copied to clipboard

Running YOLOv5 ONNX model with onnx parser of armnn fails with unsupported operation

Open Murari007 opened this issue 2 years ago • 2 comments

Traceback (most recent call last): File "/home/sl-rpi-5/Downloads/armnn/python/pyarmnn/examples/object_detection/yolov5_onnx_parser.py", line 114, in main(args) File "/home/sl-rpi-5/Downloads/armnn/python/pyarmnn/examples/object_detection/yolov5_onnx_parser.py", line 55, in main executor = NetworkExecutor(*exec_input_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sl-rpi-5/Downloads/armnn/python/pyarmnn/examples/object_detection/network_executor.py", line 22, in init self.network_id, self.runtime, self.input_binding_info, self.output_binding_info = self.create_network() ^^^^^^^^^^^^^^^^^^^^^ File "/home/sl-rpi-5/Downloads/armnn/python/pyarmnn/examples/object_detection/network_executor.py", line 60, in create_network network = parser.CreateNetworkFromBinaryFile(self.model_file) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/sl-rpi-5/armnn-pi/myenv/lib/python3.11/site-packages/pyarmnn/_generated/pyarmnn_onnxparser.py", line 656, in CreateNetworkFromBinaryFile return _pyarmnn_onnxparser.IOnnxParser_CreateNetworkFromBinaryFile(self, graphFile) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Unsupported operation Mul for node '/model.0/act/Mul' at function LoadGraph [/home/sl-rpi-5/armnn-pi/armnn/build-tool/scripts/source/armnn/src/armnnOnnxParser/OnnxParser.cpp:966]

Murari007 avatar May 01 '24 07:05 Murari007

Hello,

Your issue is somewhat similar to the following one: https://github.com/ARM-software/armnn/issues/761.

Mul support has not been added to the ONNX parser. The work to add this support is on our radar but has not been prioritized in the near future. I can make 3 suggestions to get things running on your side:

  • Convert the onnx model to tflite and run through our tflite parser or delegate.
  • If you want to try to add support for the operators to the ONNX parser we do welcome contributions. For more information on contributing to ArmNN please see the Contributing page on the MLPlatform.org website, or see the Contributor Guide.
  • You can use ONNX runtime with ACL as an option to accelerate your model also. See here: https://onnxruntime.ai/docs/execution-providers/community-maintained/ACL-ExecutionProvider.html.

Kind Regards, Cathal.

catcor01 avatar May 01 '24 11:05 catcor01

Hello @catcor01

Thanks for the reply. I will try the suggested alternative methods & get back soon.

Kind Regads, Murari

Murari007 avatar May 01 '24 17:05 Murari007