我使用onnx官方的代码对我的onnx模型进行了量化,之后转换成om,出现下面的错误应该怎么解决?
转换命令:atc --model=/media/ai/root_fs/xianchang_hole_static_onnx.onnx --framework=5 --output=/media/ai/root_fs/xianchang_hole_static_onnx --soc_version=Ascend310B4 --log=error
错误:
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E16005: [PID: 250308] 2025-11-20-09:03:09.002.059 The model has [9] [--domain_version] fields, but only one is allowed.
Solution: Invalid ONNX model. Modify the ONNX model. If no domain is specified on the operator node, only one domain can be specified on the model.
TraceBack (most recent call last):
Model parse to graph failed, graph name:xianchang_hole_static_onnx.[FUNC:ModelParseToGraph][FILE:onnx_parser.cc][LINE:936]
ATC model parse ret fail.[FUNC:ParseGraph][FILE:omg.cc][LINE:776]
①我的onnx模型应该是没有问题的,因为他可以正常使用onnxruntime进行推理。
②在别的帖子看到的解决方案:cid:link_0 用这个库尝试了一下:代码如下:
from magiconnx import OnnxGraph
graph = OnnxGraph('/home/HwHiAiUser/Documents/yolov8_web_inference/model/xianchang_hole_static_onnx.onnx')
print(graph.inputs)
print(graph.outputs)
graph.keep_default_domain()
graph.save('basic_vsr_v1.onnx')
又出现新的错误:
Traceback (most recent call last):
File "/home/HwHiAiUser/Documents/yolov8_web_inference/test_model/onnx_simple.py", line 3, in <module>
graph = OnnxGraph('/home/HwHiAiUser/Documents/yolov8_web_inference/model/xianchang_hole_static_onnx.onnx')
File "/home/HwHiAiUser/.conda/envs/3dinference/lib/python3.10/site-packages/magiconnx/utils/log.py", line 22, in wrapper
return func(*args, **kwargs)
File "/home/HwHiAiUser/.conda/envs/3dinference/lib/python3.10/site-packages/magiconnx/graph.py", line 36, in __init__
self._update_ops_map(out, node)
File "/home/HwHiAiUser/.conda/envs/3dinference/lib/python3.10/site-packages/magiconnx/graph.py", line 340, in _update_ops_map
raise RuntimeError(
RuntimeError: This is an invalid model. Error: two nodes with same node name (images_QuantizeLinear)
所以最开始的问题应该怎么解决?
我使用onnx官方的代码对我的onnx模型进行了量化,之后转换成om,出现下面的错误应该怎么解决?
转换命令:atc --model=/media/ai/root_fs/xianchang_hole_static_onnx.onnx --framework=5 --output=/media/ai/root_fs/xianchang_hole_static_onnx --soc_version=Ascend310B4 --log=error
错误:ATC run failed, Please check the detail log, Try 'atc --help' for more information
E16005: [PID: 250308] 2025-11-20-09:03:09.002.059 The model has [9] [--domain_version] fields, but only one is allowed.
Solution: Invalid ONNX model. Modify the ONNX model. If no domain is specified on the operator node, only one domain can be specified on the model.
TraceBack (most recent call last):
Model parse to graph failed, graph name:xianchang_hole_static_onnx.[FUNC:ModelParseToGraph][FILE:onnx_parser.cc][LINE:936]
ATC model parse ret fail.[FUNC:ParseGraph][FILE:omg.cc][LINE:776]
①我的onnx模型应该是没有问题的,因为他可以正常使用onnxruntime进行推理。
②在别的帖子看到的解决方案:cid:link_0 用这个库尝试了一下:代码如下:
from magiconnx import OnnxGraph
graph = OnnxGraph('/home/HwHiAiUser/Documents/yolov8_web_inference/model/xianchang_hole_static_onnx.onnx')
print(graph.inputs)
print(graph.outputs)
graph.keep_default_domain()
graph.save('basic_vsr_v1.onnx')
又出现新的错误:
Traceback (most recent call last):
File "/home/HwHiAiUser/Documents/yolov8_web_inference/test_model/onnx_simple.py", line 3, in <module>
graph = OnnxGraph('/home/HwHiAiUser/Documents/yolov8_web_inference/model/xianchang_hole_static_onnx.onnx')
File "/home/HwHiAiUser/.conda/envs/3dinference/lib/python3.10/site-packages/magiconnx/utils/log.py", line 22, in wrapper
return func(*args, **kwargs)
File "/home/HwHiAiUser/.conda/envs/3dinference/lib/python3.10/site-packages/magiconnx/graph.py", line 36, in __init__
self._update_ops_map(out, node)
File "/home/HwHiAiUser/.conda/envs/3dinference/lib/python3.10/site-packages/magiconnx/graph.py", line 340, in _update_ops_map
raise RuntimeError(
RuntimeError: This is an invalid model. Error: two nodes with same node name (images_QuantizeLinear)
所以最开始的问题应该怎么解决?