mindspore.convert_model

mindspore.convert_model(mindir_file, convert_file, file_format)[source]

Convert mindir model to other format model. Current version only support convert to “ONNX” format.

Note

This is an experimental function that is subject to change or deletion.

Parameters
  • mindir_file (str) – MindIR file name.

  • convert_file (str) – Convert model file name.

  • file_format (str) – Convert model’s format, current version only supports “ONNX”.

Raises
  • TypeError – If the parameter mindir_file is not str.

  • TypeError – If the parameter convert_file is not str.

  • ValueError – If the parameter file_format is not “ONNX”.

Examples

>>> convert_model("lenet.mindir", "lenet.onnx", "ONNX")