This topic describes how to automatically import Machine Learning Platform for AI (PAI) models to Object Storage Service (OSS) for a scheduling task.

Procedure

  1. Log on to the PAI console.
  2. In the left-side navigation pane, choose Model Training > Studio-Modeling Visualization to go to the PAI Visualization Modeling page.
    When you create a project, we recommend that you select By usage for the project. PAI-TensorFlow tasks can run only by using GPU resources.PAI-Studio
  3. Find the required project and click Machine Learning in the Operation column.
  4. In the left-side navigation pane of the tab that appears, click Models. On the page that appears, drag and drop the model that you want to mange to the canvas, right-click the model, and choose Model Option > Show Model to obtain the model name.
  5. In the dialog box that appears, find the model name and remove the prefix pailr_coefficient from the name.
    Delete a prefix
  6. Determine the Alibaba Cloud resource name (ARN) that is the unique credential used by PAI to access OSS.
    OSS ARN
  7. Run the command to save the model.
    To periodically import models to OSS, you must first create an SQL node in DataWorks and run the following command:
    pai -name modeltransfer2oss
        -DmodelName=xlab_m_logisticregres_1006580_v0(Model name)
        -DossPath="oss://images-beijing.oss-cn-beijing-internal.aliyuncs.com/aohai/"(OSS path)
        -Darn="acs:ram::1664081855183111:role/aliyunodpspaidefaultrole"(ARN)
        -Dformat=pmml
        -Doverwrite=true/false;