All Products
Search
Document Center

Platform For AI:Model export

Last Updated:Apr 03, 2024

You can use the Model export component to export a model that is trained in MaxCompute to a specific Object Storage Service (OSS) path. This topic describes how to use the Model export component.

Prerequisites

Platform for AI (PAI) is authorized to access OSS. For more information, see Grant the permissions that are required to use Machine Learning Designer.

Supported upstream components

Configure the component in the PAI console

You can configure the following parameters on the Parameters Setting tab of the Model export component.image.png

Parameter

Description

Rename

  • If you configure this parameter, the exported model is renamed before it is saved.

  • Otherwise, the exported model uses its original name.

Note

If you want to override the previously exported model each time you export a new model, you must configure the Rename parameter and select the Overwrite option.

Overwrite

If you select this option, the generated model files override the model files that have the same names in the specified OSS path.

Export Model Type

Valid values:

  • original: The exported model files contain a file whose suffix is .meta and a file whose suffix is .model.

  • pmml: The suffix of the exported files is .xml.

Types of exported models supported by upstream components:

  • General components: The original and pmml types are supported. You can connect the exported models to the input port on the left of the Model export component. 端口1

  • PS components allow you to export models only in the original format. You must connect the component from which you want to export models to Port 1 and Port 2 of the Model export component.端口1&端口2

Configure the component by using PAI commands

You can run the following PAI commands by using the SQL Script component or the ODPS SQL nodes of DataWorks to configure the component:

PAI -name generalmodeltransfer2oss
-project algo_public
-Dformat="original"
-Drename="model_export"
-Doverwrite="false"
-DossPath="oss://examplebucket-cn-hangzhou-internal.aliyuncs.com/export/"
-Darn="acs:ram::xxxxxxxxxx:role/aliyunodpspaidefaultrole"
-DmodelName="model_flow_aius5tamq5rv4x****_node_anprs9ufo40opc****_model"

The following table describes the parameters used in the preceding syntax.

Parameter

Required

Description

Default value

format

Yes

The format of the model that you want to export. Valid values:

  • original

  • pmml

None

rename

No

The new name of the model.

None, which indicates that the name is not changed.

overwrite

No

Specifies whether to overwrite the model that has the same name in the specified path. Valid values:

  • true

  • false

false

ossPath

Yes

The OSS path of the model that you want to export.

None

arn

Yes

The authorization information. To obtain the authorization information, log on to the PAI console and go to the Dependent Services page. In the Designer section, find OSS and click View Authorization in the Actions column. For more information, see Grant the permissions that are required to use Machine Learning Designer.

None

inputTable

No

If you want to export models obtained from PS-related components, you must configure the output model table for these components.

None

modelName

Yes

The name of the model that you want to export.

None