code: def export_onnx(
      path_prefix, feed_vars, fetch_vars, executor, program
  ):
      from paddle2onnx.graph import PaddleGraph, ONNXGraph
      from paddle2onnx.passes import PassManager
  
      opset_version = 10
      enable_onnx_checker = True
      verbose = False
  
      paddle_graph = PaddleGraph.build_from_program(
          program, feed_vars, fetch_vars, paddle.fluid.global_scope()
      )
  
      onnx_graph = ONNXGraph.build(paddle_graph, opset_version, verbose)
      onnx_graph = PassManager.run_pass(
          onnx_graph, ["inplace_node_pass"]
      )
  
      onnx_proto = onnx_graph.export_proto(enable_onnx_checker)
  
      try:
          # mkdir may conflict if pserver and trainer are running on the same machine
          dirname = os.path.dirname(path_prefix)
          os.makedirs(dirname)
      except OSError as e:
          if e.errno != errno.EEXIST:
              raise
      model_path = path_prefix + ".onnx"
      if os.path.isdir(model_path):
          raise ValueError(
              "'{}' is an existing directory.".format(model_path)
          )
  
      with open(model_path, "wb") as f:
          f.write(onnx_proto.SerializeToString())
  
file_path: insightface/recognition/arcface_paddle/static/export.py
imports: import errno
  import os
  import numpy
  import paddle
  from .utils.io import Checkpoint
  from .None import backbones
  from .static_model import StaticModel
label_desc: Use image node_id 1 for calling a global function with example usage: export_onnx(path_prefix, feed_vars, fetch_vars, executor, program) without return types