From 13318d60ef129b83ceacec97210ce48a9267e8af Mon Sep 17 00:00:00 2001 From: inisis Date: Wed, 13 Nov 2024 01:58:32 +0800 Subject: [PATCH] fix metadata feature --- .../third_party/onnx_graphsurgeon/exporters/onnx_exporter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py b/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py index f1c9999..47f350d 100644 --- a/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py +++ b/onnxslim/third_party/onnx_graphsurgeon/exporters/onnx_exporter.py @@ -367,7 +367,8 @@ def export_onnx(graph: Graph, do_type_check=True, **kwargs) -> "onnx.ModelProto" kwargs["ir_version"] = graph.ir_version model = onnx.helper.make_model(onnx_graph, **kwargs) - model.metadata_props.extend(graph.metadata_props) + if graph.metadata_props is not None: + model.metadata_props.extend(graph.metadata_props) model.producer_name = graph.producer_name model.producer_version = graph.producer_version return model