Installation and configuration
Install PAI SDK for Python and configure workspace credentials and region settings to train and deploy models.
PAI SDK for Python is used for model training and deployment and does not support cluster-level resource management, such as starting and stopping instances, quota management, or workspace management. Use the Alibaba Cloud Management Console to manage these resources.
Prerequisites
You have Create an AccessKey.
You have Create and manage workspaces.
You have Console quick start.
Python 3.8 or later.
RAM users must have the following permissions on the workspace and Object Storage Service (OSS) buckets:
Assign the developer or administrator role to the RAM user for submitting training jobs. For more information, see Manage members of the workspace.
Grant read and write permissions to store code and models in OSS buckets. For more information, see "Grant your RAM user or RAM role the permissions to access OSS" in Grant the permissions that are required to use Machine Learning Designer.
Installation
Run the following command to install PAI SDK for Python:
pip install "alipai>=0.4.0"Configuration
Run the following command to launch the configuration wizard:
# Run after SDK installation.
python -m pai.toolkit.configConfiguration example:
$ python -m pai.toolkit.config
Please enter your Alibaba Cloud AccessKeyId: LTAxxx
Please enter your Alibaba Cloud AccessKeySecret: ********************************
Currently configured credentials and region:
AccessKeyId: LTAIxxx
AccessKeySecret: nS0c********************PVLe
RegionId: cn-hangzhou
IdentityType: Account
Cloud service dependency check:
AliyunODPSPAIDefaultRole Authorized
AliyunPAIAccessingOSSRole Authorized
AliyunPAIDLCAccessingOSSRole Authorized
AliyunPAIDLCDefaultRole Authorized
Currently selected workspace information:
WorkspaceName: xxx
WorkspaceId: xxx
Roles: PAI.WorkspaceOwner, PAI.WorkspaceAdmin
Please configure the OSS Bucket to use:
Do you want to use the default OSS Bucket of the current workspace (oss://xxx)? (y/n)After the configuration succeeds, the following message is displayed: Configuration saved successfully: <Path to which the configurations are saved>.
Next steps
After you complete the configuration, you can start submitting training jobs. For more information, see Submit a training job.