mindspore.save_mindir

View Source On Gitee
mindspore.save_mindir(model, file_name)[source]

save protobuf file.

Note

The interface is deprecated from version 2.5 and will be removed in a future version.

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