Hi, I tried to convert my trained YOLOV5 file into onnx and convert it using conversion tools
But I encounter this problem. (I used onnx==1.6.0) as the documentation said.
Any idea why this causes the problem of model conversion and how to solve it?
Many thanks in advance. (This model conversion has given me 2 sleepless nights already…)
E Calc node ScatterND_638 output shape fail
W ----------------Warning(2)----------------
Traceback (most recent call last):
File “acuitylib/onnx_ir/onnx_numpy_backend/shape_inference.py”, line 50, in infer_shape
File “/home/wudi/code/amlnn_tools/aml_npu_sdk_6.4.3/acuity-toolkit/bin/acuitylib/acuitylib/onnx_ir/onnx_numpy_backend/ops/scatter_nd.py”, line 33, in ScatterND
return scatter_nd_impl(data, indices, updates)
File “/home/wudi/code/amlnn_tools/aml_npu_sdk_6.4.3/acuity-toolkit/bin/acuitylib/acuitylib/onnx_ir/onnx_numpy_backend/ops/scatter_nd.py”, line 24, in scatter_nd_impl
output[indices[i]] = updates[i]
Here is the error message. Could it be onnx to numpy issue?
Traceback (most recent call last):
File "acuitylib/onnx_ir/onnx_numpy_backend/shape_inference.py", line 50, in infer_shape
File "/home/wudi/code/amlnn_tools/aml_npu_sdk_6.4.3/acuity-toolkit/bin/acuitylib/acuitylib/onnx_ir/onnx_numpy_backend/ops/scatter_nd.py", line 28, in ScatterND
return scatter_nd_impl(data, indices, updates)
File "/home/wudi/code/amlnn_tools/aml_npu_sdk_6.4.3/acuity-toolkit/bin/acuitylib/acuitylib/onnx_ir/onnx_numpy_backend/ops/scatter_nd.py", line 21, in scatter_nd_impl
output[indices[i]] = updates[i]
IndexError: arrays used as indices must be of integer (or boolean) type
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "convertonnx.py", line 52, in <module>
File "convertonnx.py", line 45, in main
File "acuitylib/vsi_nn.py", line 153, in load_onnx
File "acuitylib/app/importer/import_onnx.py", line 107, in run
File "acuitylib/converter/convert_onnx.py", line 62, in __init__
File "acuitylib/converter/convert_onnx.py", line 220, in _shape_inference
File "acuitylib/onnx_ir/onnx_numpy_backend/shape_inference.py", line 52, in infer_shape
File "acuitylib/acuitylog.py", line 251, in e
ValueError: Calc node ScatterND_935 output shape fail
[446] Failed to execute script convertonnx
I checked, the index i in the following quote is floating number.
I will further check what is this scatter function doing and try to correct the float to int, I will keep you posted @Frank
One more thing, can we convert .onnx, is the script trying to go from the output backward to input? (It seems the case from my understanding: cause the error will start from the output first…). Could you kindly help to clarify that @Frank . Thanks a lot!
There is the same question of us too, some cases indicate that the ScatterND is not a supported operator when transfer .onnx to TRT. But we can not analyze the problem there, is the mistake of data’s shape causing this problem or the ScatterND is also not supported in RKNN. This will guide us to choose verify the data’s shape or to rewrite ScatterND in YOLOv5.
Have you solved this problem,please provide some details of steps. Thanks!