class_docstr: ModuleV1 is an old version of the PaddleHub Module format, which is no longer in use. In order to maintain
  compatibility, users can still load the corresponding Module for prediction. User should call `hub.Module`
  to initialize the corresponding object, rather than `ModuleV1`.
class_docstr_tok: ["ModuleV1","is","an","old","version","of","the","PaddleHub","Module","format",",","which","is","no","longer","in","use",".","In","order","to","maintain","compatibility",",","users","can","still","load","the","corresponding","Module","for","prediction",".","User","should","call","`","hub.Module","`","to","initialize","the","corresponding","object",",","rather","than","`","ModuleV1","`","."]
docstr: Export the model to ONNX format.
  
  Args:
      dirname(str): The directory to save the onnx model.
      **kwargs(dict|optional): Other export configuration options for compatibility, some may be removed
          in the future. Don't use them If not necessary. Refer to https://github.com/PaddlePaddle/paddle2onnx
          for more information.
docstr_tok: ["Export","the","model","to","ONNX","format",".","Args",":","dirname","(","str",")",":","The","directory","to","save","the","onnx","model",".","*","*","kwargs","(","dict|optional",")",":","Other","export","configuration","options","for","compatibility",",","some","may","be","removed","in","the","future",".","Do","n't","use","them","If","not","necessary",".","Refer","to","https",":","\/\/github.com\/PaddlePaddle\/paddle2onnx","for","more","information","."]
code: def export_onnx_model(self, dirname: str, **kwargs):
      """
      Export the model to ONNX format.
  
      Args:
          dirname(str): The directory to save the onnx model.
          **kwargs(dict|optional): Other export configuration options for compatibility, some may be removed
              in the future. Don't use them If not necessary. Refer to https://github.com/PaddlePaddle/paddle2onnx
              for more information.
      """
      feed_dict, fetch_dict, program = self.context(
          for_test=True, trainable=False
      )
      inputs = set([var.name for var in feed_dict.values()])
      if self.type == "CV/classification":
          outputs = [fetch_dict["class_probs"]]
      else:
          outputs = set([var.name for var in fetch_dict.values()])
          outputs = [
              program.global_block().vars[key] for key in outputs
          ]
  
      save_file = os.path.join(dirname, "{}.onnx".format(self.name))
      paddle2onnx.program2onnx(
          program=program,
          scope=paddle.static.global_scope(),
          feed_var_names=inputs,
          target_vars=outputs,
          save_file=save_file,
          **kwargs,
      )
  
imports: import functools
  import os
  from typing import List
  from typing import Tuple
  import paddle.io
  import paddle2onnx
  from easydict import EasyDict
  from paddlehub.compat import paddle_utils
  from paddlehub.compat.module import module_v1_utils
  from paddlehub.utils import log
  from paddlehub.utils import utils
label_desc: Use image node_id 18 for calling the ModuleV1 obj's underlying member method code with example usage: obj.export_onnx_model(dirname) without return types