mindspore.save_mindir

mindspore.save_mindir(model, file_name)[source]

save protobuf file.

Parameters
  • model (ModelProto) – mindir model

  • file_name (str) – File name.

Raises
  • TypeError – The argument model is not a ModelProto object.

  • ValueError – The file path does not exist or the file_name format is incorrect.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore as ms
>>> md = ms.load_mindir("test.mindir")
>>> md.user_info["version"]="pangu v100"
>>> ms.save_mindir(md,"test_new.mindir")
>>> md_new = ms.load_mindir("test_new.mindir")
>>> md_new.user_info