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