diff --git a/docs/modelarts/sdk-ref/ALL_META.TXT.json b/docs/modelarts/sdk-ref/ALL_META.TXT.json new file mode 100644 index 00000000..70aaf559 --- /dev/null +++ b/docs/modelarts/sdk-ref/ALL_META.TXT.json @@ -0,0 +1,702 @@ +[ + { + "uri":"modelarts_04_0001.html", + "product_code":"modelarts", + "code":"1", + "des":"This document describes how to install and configure a development environment and call functions provided by ModelArts SDK for secondary development.", + "doc_type":"sdkreference", + "kw":"Before You Start,SDK Reference", + "title":"Before You Start", + "githuburl":"" + }, + { + "uri":"modelarts_04_0002.html", + "product_code":"modelarts", + "code":"2", + "des":"ModelArts Software Development Kit (ModelArts SDK) encapsulates the ModelArts RESTful APIs in Python language to simplify application development. You can directly call M", + "doc_type":"sdkreference", + "kw":"SDK Overview,SDK Reference", + "title":"SDK Overview", + "githuburl":"" + }, + { + "uri":"modelarts_04_0003.html", + "product_code":"modelarts", + "code":"3", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Preparations", + "title":"Preparations", + "githuburl":"" + }, + { + "uri":"modelarts_04_0005.html", + "product_code":"modelarts", + "code":"4", + "des":"ModelArts SDK can be used in the following environments:ModelArts SDK has been integrated into ModelArts Notebook and can be directly used without session authentication.", + "doc_type":"sdkreference", + "kw":"Environment Preparations,Preparations,SDK Reference", + "title":"Environment Preparations", + "githuburl":"" + }, + { + "uri":"modelarts_04_0004.html", + "product_code":"modelarts", + "code":"5", + "des":"Download the ModelArts SDK software package of the latest version.After the SDK is downloaded, you can use pip to install it. For details about how to install pip, see th", + "doc_type":"sdkreference", + "kw":"Downloading and Installing the SDK,Preparations,SDK Reference", + "title":"Downloading and Installing the SDK", + "githuburl":"" + }, + { + "uri":"modelarts_04_0044.html", + "product_code":"modelarts", + "code":"6", + "des":"When calling APIs, you need to specify the project ID in certain URLs. To do so, you need to obtain the project ID first. To obtain a project ID, perform the following op", + "doc_type":"sdkreference", + "kw":"Viewing the Project ID,Preparations,SDK Reference", + "title":"Viewing the Project ID", + "githuburl":"" + }, + { + "uri":"modelarts_04_0300.html", + "product_code":"modelarts", + "code":"7", + "des":"Using the SDK in non-notebook environments needs to call IAM, OBS, and ModelArts. Therefore, the endpoints of these services are required. Therefore, the endpoints of the", + "doc_type":"sdkreference", + "kw":"Configuring a Service Endpoint,Preparations,SDK Reference", + "title":"Configuring a Service Endpoint", + "githuburl":"" + }, + { + "uri":"modelarts_04_0153.html", + "product_code":"modelarts", + "code":"8", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Session Authentication", + "title":"Session Authentication", + "githuburl":"" + }, + { + "uri":"modelarts_04_0123.html", + "product_code":"modelarts", + "code":"9", + "des":"The session module authenticates in-cloud resources and initializes ModelArts SDK Client and OBS Client. After a session is set up, you can directly call the ModelArts SD", + "doc_type":"sdkreference", + "kw":"Overview of Session Authentication,Session Authentication,SDK Reference", + "title":"Overview of Session Authentication", + "githuburl":"" + }, + { + "uri":"modelarts_04_0154.html", + "product_code":"modelarts", + "code":"10", + "des":"This authentication method is available for OBS Management, Training Management, Model Management, and Service Management.Set account to your domain name and username to ", + "doc_type":"sdkreference", + "kw":"Authentication Using the Username and Password,Session Authentication,SDK Reference", + "title":"Authentication Using the Username and Password", + "githuburl":"" + }, + { + "uri":"modelarts_04_0155.html", + "product_code":"modelarts", + "code":"11", + "des":"This authentication method is available for OBS Management, Training Management, Model Management, and Service Management.Parameters in this command are described as foll", + "doc_type":"sdkreference", + "kw":"AK/SK-based Authentication,Session Authentication,SDK Reference", + "title":"AK/SK-based Authentication", + "githuburl":"" + }, + { + "uri":"modelarts_04_0006.html", + "product_code":"modelarts", + "code":"12", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"OBS Management (Recommended)", + "title":"OBS Management (Recommended)", + "githuburl":"" + }, + { + "uri":"modelarts_04_0217.html", + "product_code":"modelarts", + "code":"13", + "des":"ModelArts SDK 1.1.3 supports OBS management, including uploading and downloading files and folders. The operations are as follows:Uploading a File to OBSUploading a Folde", + "doc_type":"sdkreference", + "kw":"Overview of OBS Management,OBS Management (Recommended),SDK Reference", + "title":"Overview of OBS Management", + "githuburl":"" + }, + { + "uri":"modelarts_04_0218.html", + "product_code":"modelarts", + "code":"14", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Uploading a File to OBS,OBS Management (Recommended),SDK Reference", + "title":"Uploading a File to OBS", + "githuburl":"" + }, + { + "uri":"modelarts_04_0219.html", + "product_code":"modelarts", + "code":"15", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Uploading a Folder to OBS,OBS Management (Recommended),SDK Reference", + "title":"Uploading a Folder to OBS", + "githuburl":"" + }, + { + "uri":"modelarts_04_0220.html", + "product_code":"modelarts", + "code":"16", + "des":"If the size of a file in a folder exceeds 5 GB, the file cannot be downloaded in this mode.In the ModelArts notebook instance, you do not need to enter authentication par", + "doc_type":"sdkreference", + "kw":"Downloading a File from OBS,OBS Management (Recommended),SDK Reference", + "title":"Downloading a File from OBS", + "githuburl":"" + }, + { + "uri":"modelarts_04_0221.html", + "product_code":"modelarts", + "code":"17", + "des":"If the size of a file in a folder exceeds 5 GB, the file cannot be downloaded in this mode. However, other files whose size is less than 5 GB in the folder can be downloa", + "doc_type":"sdkreference", + "kw":"Downloading a Folder from OBS,OBS Management (Recommended),SDK Reference", + "title":"Downloading a Folder from OBS", + "githuburl":"" + }, + { + "uri":"modelarts_04_0157.html", + "product_code":"modelarts", + "code":"18", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Training Management", + "title":"Training Management", + "githuburl":"" + }, + { + "uri":"modelarts_04_0158.html", + "product_code":"modelarts", + "code":"19", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Training Jobs", + "title":"Training Jobs", + "githuburl":"" + }, + { + "uri":"modelarts_04_0131.html", + "product_code":"modelarts", + "code":"20", + "des":"For training on the training platform, if the training fails, you can view the detailed log information on the platform or by calling the API in Querying Training Job Log", + "doc_type":"sdkreference", + "kw":"Creating a Training Job,Training Jobs,SDK Reference", + "title":"Creating a Training Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0160.html", + "product_code":"modelarts", + "code":"21", + "des":"In a ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other develop", + "doc_type":"sdkreference", + "kw":"Querying the List of Training Jobs,Training Jobs,SDK Reference", + "title":"Querying the List of Training Jobs", + "githuburl":"" + }, + { + "uri":"modelarts_04_0161.html", + "product_code":"modelarts", + "code":"22", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the Details About a Training Job,Training Jobs,SDK Reference", + "title":"Querying the Details About a Training Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0162.html", + "product_code":"modelarts", + "code":"23", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Modifying the Description of a Training Job,Training Jobs,SDK Reference", + "title":"Modifying the Description of a Training Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0163.html", + "product_code":"modelarts", + "code":"24", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Obtaining the Name of a Training Job Log File,Training Jobs,SDK Reference", + "title":"Obtaining the Name of a Training Job Log File", + "githuburl":"" + }, + { + "uri":"modelarts_04_0164.html", + "product_code":"modelarts", + "code":"25", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying Training Job Logs,Training Jobs,SDK Reference", + "title":"Querying Training Job Logs", + "githuburl":"" + }, + { + "uri":"modelarts_04_0166.html", + "product_code":"modelarts", + "code":"26", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Deleting a Training Job,Training Jobs,SDK Reference", + "title":"Deleting a Training Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0167.html", + "product_code":"modelarts", + "code":"27", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Training Job Versions", + "title":"Training Job Versions", + "githuburl":"" + }, + { + "uri":"modelarts_04_0168.html", + "product_code":"modelarts", + "code":"28", + "des":"A training job must exist before you create a version for it. You can create a training job version based on Creating a Training Job or job_id and version_id of the objec", + "doc_type":"sdkreference", + "kw":"Creating a Training Job Version,Training Job Versions,SDK Reference", + "title":"Creating a Training Job Version", + "githuburl":"" + }, + { + "uri":"modelarts_04_0169.html", + "product_code":"modelarts", + "code":"29", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the List of Training Job Versions,Training Job Versions,SDK Reference", + "title":"Querying the List of Training Job Versions", + "githuburl":"" + }, + { + "uri":"modelarts_04_0170.html", + "product_code":"modelarts", + "code":"30", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the Details About a Training Job Version,Training Job Versions,SDK Reference", + "title":"Querying the Details About a Training Job Version", + "githuburl":"" + }, + { + "uri":"modelarts_04_0171.html", + "product_code":"modelarts", + "code":"31", + "des":"You can stop a training job version that is being created only when the job is running.In the ModelArts notebook instance, you do not need to enter authentication paramet", + "doc_type":"sdkreference", + "kw":"Stopping a Training Job Version,Training Job Versions,SDK Reference", + "title":"Stopping a Training Job Version", + "githuburl":"" + }, + { + "uri":"modelarts_04_0172.html", + "product_code":"modelarts", + "code":"32", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Deleting a Training Job Version,Training Job Versions,SDK Reference", + "title":"Deleting a Training Job Version", + "githuburl":"" + }, + { + "uri":"modelarts_04_0173.html", + "product_code":"modelarts", + "code":"33", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Training Job Parameter Configuration", + "title":"Training Job Parameter Configuration", + "githuburl":"" + }, + { + "uri":"modelarts_04_0174.html", + "product_code":"modelarts", + "code":"34", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Creating a Training Job Configuration,Training Job Parameter Configuration,SDK Reference", + "title":"Creating a Training Job Configuration", + "githuburl":"" + }, + { + "uri":"modelarts_04_0175.html", + "product_code":"modelarts", + "code":"35", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the List of Training Job Parameter Configuration Objects,Training Job Parameter Configurati", + "title":"Querying the List of Training Job Parameter Configuration Objects", + "githuburl":"" + }, + { + "uri":"modelarts_04_0176.html", + "product_code":"modelarts", + "code":"36", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the List of Training Job Configurations,Training Job Parameter Configuration,SDK Reference", + "title":"Querying the List of Training Job Configurations", + "githuburl":"" + }, + { + "uri":"modelarts_04_0177.html", + "product_code":"modelarts", + "code":"37", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the Details About a Training Job Configuration,Training Job Parameter Configuration,SDK Ref", + "title":"Querying the Details About a Training Job Configuration", + "githuburl":"" + }, + { + "uri":"modelarts_04_0178.html", + "product_code":"modelarts", + "code":"38", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Modifying a Training Job Configuration,Training Job Parameter Configuration,SDK Reference", + "title":"Modifying a Training Job Configuration", + "githuburl":"" + }, + { + "uri":"modelarts_04_0179.html", + "product_code":"modelarts", + "code":"39", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Deleting a Training Job Configuration,Training Job Parameter Configuration,SDK Reference", + "title":"Deleting a Training Job Configuration", + "githuburl":"" + }, + { + "uri":"modelarts_04_0180.html", + "product_code":"modelarts", + "code":"40", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Visualization Jobs", + "title":"Visualization Jobs", + "githuburl":"" + }, + { + "uri":"modelarts_04_0181.html", + "product_code":"modelarts", + "code":"41", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Creating a Visualization Job,Visualization Jobs,SDK Reference", + "title":"Creating a Visualization Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0182.html", + "product_code":"modelarts", + "code":"42", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the List of Visualization Job Objects,Visualization Jobs,SDK Reference", + "title":"Querying the List of Visualization Job Objects", + "githuburl":"" + }, + { + "uri":"modelarts_04_0183.html", + "product_code":"modelarts", + "code":"43", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the List of Visualization Jobs,Visualization Jobs,SDK Reference", + "title":"Querying the List of Visualization Jobs", + "githuburl":"" + }, + { + "uri":"modelarts_04_0184.html", + "product_code":"modelarts", + "code":"44", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the Details About a Visualization Job,Visualization Jobs,SDK Reference", + "title":"Querying the Details About a Visualization Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0185.html", + "product_code":"modelarts", + "code":"45", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Modifying the Description of a Visualization Job,Visualization Jobs,SDK Reference", + "title":"Modifying the Description of a Visualization Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0186.html", + "product_code":"modelarts", + "code":"46", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Stopping a Visualization Job,Visualization Jobs,SDK Reference", + "title":"Stopping a Visualization Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0187.html", + "product_code":"modelarts", + "code":"47", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Restarting a Visualization Job,Visualization Jobs,SDK Reference", + "title":"Restarting a Visualization Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0188.html", + "product_code":"modelarts", + "code":"48", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Deleting a Visualization Job,Visualization Jobs,SDK Reference", + "title":"Deleting a Visualization Job", + "githuburl":"" + }, + { + "uri":"modelarts_04_0189.html", + "product_code":"modelarts", + "code":"49", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Resource and Engine Specifications", + "title":"Resource and Engine Specifications", + "githuburl":"" + }, + { + "uri":"modelarts_04_0190.html", + "product_code":"modelarts", + "code":"50", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying a Built-in Algorithm,Resource and Engine Specifications,SDK Reference", + "title":"Querying a Built-in Algorithm", + "githuburl":"" + }, + { + "uri":"modelarts_04_0191.html", + "product_code":"modelarts", + "code":"51", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the List of Resource Flavors,Resource and Engine Specifications,SDK Reference", + "title":"Querying the List of Resource Flavors", + "githuburl":"" + }, + { + "uri":"modelarts_04_0192.html", + "product_code":"modelarts", + "code":"52", + "des":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "doc_type":"sdkreference", + "kw":"Querying the List of Engine Types,Resource and Engine Specifications,SDK Reference", + "title":"Querying the List of Engine Types", + "githuburl":"" + }, + { + "uri":"modelarts_04_0077.html", + "product_code":"modelarts", + "code":"53", + "des":"Table 1 describes the job statuses.", + "doc_type":"sdkreference", + "kw":"Job Statuses,Training Management,SDK Reference", + "title":"Job Statuses", + "githuburl":"" + }, + { + "uri":"modelarts_04_0193.html", + "product_code":"modelarts", + "code":"54", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Model Management", + "title":"Model Management", + "githuburl":"" + }, + { + "uri":"modelarts_04_0194.html", + "product_code":"modelarts", + "code":"55", + "des":"The model import function covers the following aspects:Initialize the existing model and create a model object based on the model ID.Create a model. For details about the", + "doc_type":"sdkreference", + "kw":"Importing a Model,Model Management,SDK Reference", + "title":"Importing a Model", + "githuburl":"" + }, + { + "uri":"modelarts_04_0195.html", + "product_code":"modelarts", + "code":"56", + "des":"In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development enviro", + "doc_type":"sdkreference", + "kw":"Obtaining the Model List,Model Management,SDK Reference", + "title":"Obtaining the Model List", + "githuburl":"" + }, + { + "uri":"modelarts_04_0196.html", + "product_code":"modelarts", + "code":"57", + "des":"In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development enviro", + "doc_type":"sdkreference", + "kw":"Obtaining the Model Object List,Model Management,SDK Reference", + "title":"Obtaining the Model Object List", + "githuburl":"" + }, + { + "uri":"modelarts_04_0197.html", + "product_code":"modelarts", + "code":"58", + "des":"You can use the API to query the information about a model object.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authe", + "doc_type":"sdkreference", + "kw":"Querying the Details About a Model,Model Management,SDK Reference", + "title":"Querying the Details About a Model", + "githuburl":"" + }, + { + "uri":"modelarts_04_0198.html", + "product_code":"modelarts", + "code":"59", + "des":"You can use the API to delete a model object.In a ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details ", + "doc_type":"sdkreference", + "kw":"Deleting a Model,Model Management,SDK Reference", + "title":"Deleting a Model", + "githuburl":"" + }, + { + "uri":"modelarts_04_0199.html", + "product_code":"modelarts", + "code":"60", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Service Management", + "title":"Service Management", + "githuburl":"" + }, + { + "uri":"modelarts_04_0200.html", + "product_code":"modelarts", + "code":"61", + "des":"Service management indicates deploying a model that has been successfully created as a real-time. This feature provides functions such as real-time prediction, service de", + "doc_type":"sdkreference", + "kw":"Service Management Overview,Service Management,SDK Reference", + "title":"Service Management Overview", + "githuburl":"" + }, + { + "uri":"modelarts_04_0201.html", + "product_code":"modelarts", + "code":"62", + "des":"Real-time service deployment covers the following aspects:Initialize a real-time service.Deploy a real-time service predictor.Deploy a batch service transformer.The servi", + "doc_type":"sdkreference", + "kw":"Deploying a Real-Time Service,Service Management,SDK Reference", + "title":"Deploying a Real-Time Service", + "githuburl":"" + }, + { + "uri":"modelarts_04_0203.html", + "product_code":"modelarts", + "code":"63", + "des":"You can use the API to query details about a service object.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authenticat", + "doc_type":"sdkreference", + "kw":"Querying the Details of a Service,Service Management,SDK Reference", + "title":"Querying the Details of a Service", + "githuburl":"" + }, + { + "uri":"modelarts_04_0205.html", + "product_code":"modelarts", + "code":"64", + "des":"You can use the API to obtain the service list of a user.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication", + "doc_type":"sdkreference", + "kw":"Querying the Service List,Service Management,SDK Reference", + "title":"Querying the Service List", + "githuburl":"" + }, + { + "uri":"modelarts_04_0206.html", + "product_code":"modelarts", + "code":"65", + "des":"You can use the API to obtain the service object list of a user.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authent", + "doc_type":"sdkreference", + "kw":"Querying the List of Service Objects,Service Management,SDK Reference", + "title":"Querying the List of Service Objects", + "githuburl":"" + }, + { + "uri":"modelarts_04_0207.html", + "product_code":"modelarts", + "code":"66", + "des":"You can use the API to update the configurations of a service object.In ModelArts notebook, you do not need to enter authentication parameters for session authentication.", + "doc_type":"sdkreference", + "kw":"Updating Service Configurations,Service Management,SDK Reference", + "title":"Updating Service Configurations", + "githuburl":"" + }, + { + "uri":"modelarts_04_0208.html", + "product_code":"modelarts", + "code":"67", + "des":"You can use the API to query the monitoring information about a service.In the ModelArts notebook instance, you do not need to enter authentication parameters for session", + "doc_type":"sdkreference", + "kw":"Querying Service Monitoring Details,Service Management,SDK Reference", + "title":"Querying Service Monitoring Details", + "githuburl":"" + }, + { + "uri":"modelarts_04_0209.html", + "product_code":"modelarts", + "code":"68", + "des":"You can use the API to query the logs of a service object.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authenticatio", + "doc_type":"sdkreference", + "kw":"Querying Service Logs,Service Management,SDK Reference", + "title":"Querying Service Logs", + "githuburl":"" + }, + { + "uri":"modelarts_04_0211.html", + "product_code":"modelarts", + "code":"69", + "des":"You can delete a service in either of the following ways:Delete the service created in Deploying a Real-Time Service.Delete the service object returned in Querying the Li", + "doc_type":"sdkreference", + "kw":"Delete a Service,Service Management,SDK Reference", + "title":"Delete a Service", + "githuburl":"" + }, + { + "uri":"modelarts_04_0099.html", + "product_code":"modelarts", + "code":"70", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"sdkreference", + "kw":"Change History,SDK Reference", + "title":"Change History", + "githuburl":"" + } +] \ No newline at end of file diff --git a/docs/modelarts/sdk-ref/CLASS.TXT.json b/docs/modelarts/sdk-ref/CLASS.TXT.json new file mode 100644 index 00000000..5fd57222 --- /dev/null +++ b/docs/modelarts/sdk-ref/CLASS.TXT.json @@ -0,0 +1,632 @@ +[ + { + "desc":"This document describes how to install and configure a development environment and call functions provided by ModelArts SDK for secondary development.", + "product_code":"modelarts", + "title":"Before You Start", + "uri":"modelarts_04_0001.html", + "doc_type":"sdkreference", + "p_code":"", + "code":"1" + }, + { + "desc":"ModelArts Software Development Kit (ModelArts SDK) encapsulates the ModelArts RESTful APIs in Python language to simplify application development. You can directly call M", + "product_code":"modelarts", + "title":"SDK Overview", + "uri":"modelarts_04_0002.html", + "doc_type":"sdkreference", + "p_code":"", + "code":"2" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Preparations", + "uri":"modelarts_04_0003.html", + "doc_type":"sdkreference", + "p_code":"", + "code":"3" + }, + { + "desc":"ModelArts SDK can be used in the following environments:ModelArts SDK has been integrated into ModelArts Notebook and can be directly used without session authentication.", + "product_code":"modelarts", + "title":"Environment Preparations", + "uri":"modelarts_04_0005.html", + "doc_type":"sdkreference", + "p_code":"3", + "code":"4" + }, + { + "desc":"Download the ModelArts SDK software package of the latest version.After the SDK is downloaded, you can use pip to install it. For details about how to install pip, see th", + "product_code":"modelarts", + "title":"Downloading and Installing the SDK", + "uri":"modelarts_04_0004.html", + "doc_type":"sdkreference", + "p_code":"3", + "code":"5" + }, + { + "desc":"When calling APIs, you need to specify the project ID in certain URLs. To do so, you need to obtain the project ID first. To obtain a project ID, perform the following op", + "product_code":"modelarts", + "title":"Viewing the Project ID", + "uri":"modelarts_04_0044.html", + "doc_type":"sdkreference", + "p_code":"3", + "code":"6" + }, + { + "desc":"Using the SDK in non-notebook environments needs to call IAM, OBS, and ModelArts. Therefore, the endpoints of these services are required. Therefore, the endpoints of the", + "product_code":"modelarts", + "title":"Configuring a Service Endpoint", + "uri":"modelarts_04_0300.html", + "doc_type":"sdkreference", + "p_code":"3", + "code":"7" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Session Authentication", + "uri":"modelarts_04_0153.html", + "doc_type":"sdkreference", + "p_code":"", + "code":"8" + }, + { + "desc":"The session module authenticates in-cloud resources and initializes ModelArts SDK Client and OBS Client. After a session is set up, you can directly call the ModelArts SD", + "product_code":"modelarts", + "title":"Overview of Session Authentication", + "uri":"modelarts_04_0123.html", + "doc_type":"sdkreference", + "p_code":"8", + "code":"9" + }, + { + "desc":"This authentication method is available for OBS Management, Training Management, Model Management, and Service Management.Set account to your domain name and username to ", + "product_code":"modelarts", + "title":"Authentication Using the Username and Password", + "uri":"modelarts_04_0154.html", + "doc_type":"sdkreference", + "p_code":"8", + "code":"10" + }, + { + "desc":"This authentication method is available for OBS Management, Training Management, Model Management, and Service Management.Parameters in this command are described as foll", + "product_code":"modelarts", + "title":"AK/SK-based Authentication", + "uri":"modelarts_04_0155.html", + "doc_type":"sdkreference", + "p_code":"8", + "code":"11" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"OBS Management (Recommended)", + "uri":"modelarts_04_0006.html", + "doc_type":"sdkreference", + "p_code":"", + "code":"12" + }, + { + "desc":"ModelArts SDK 1.1.3 supports OBS management, including uploading and downloading files and folders. The operations are as follows:Uploading a File to OBSUploading a Folde", + "product_code":"modelarts", + "title":"Overview of OBS Management", + "uri":"modelarts_04_0217.html", + "doc_type":"sdkreference", + "p_code":"12", + "code":"13" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Uploading a File to OBS", + "uri":"modelarts_04_0218.html", + "doc_type":"sdkreference", + "p_code":"12", + "code":"14" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Uploading a Folder to OBS", + "uri":"modelarts_04_0219.html", + "doc_type":"sdkreference", + "p_code":"12", + "code":"15" + }, + { + "desc":"If the size of a file in a folder exceeds 5 GB, the file cannot be downloaded in this mode.In the ModelArts notebook instance, you do not need to enter authentication par", + "product_code":"modelarts", + "title":"Downloading a File from OBS", + "uri":"modelarts_04_0220.html", + "doc_type":"sdkreference", + "p_code":"12", + "code":"16" + }, + { + "desc":"If the size of a file in a folder exceeds 5 GB, the file cannot be downloaded in this mode. However, other files whose size is less than 5 GB in the folder can be downloa", + "product_code":"modelarts", + "title":"Downloading a Folder from OBS", + "uri":"modelarts_04_0221.html", + "doc_type":"sdkreference", + "p_code":"12", + "code":"17" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Training Management", + "uri":"modelarts_04_0157.html", + "doc_type":"sdkreference", + "p_code":"", + "code":"18" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Training Jobs", + "uri":"modelarts_04_0158.html", + "doc_type":"sdkreference", + "p_code":"18", + "code":"19" + }, + { + "desc":"For training on the training platform, if the training fails, you can view the detailed log information on the platform or by calling the API in Querying Training Job Log", + "product_code":"modelarts", + "title":"Creating a Training Job", + "uri":"modelarts_04_0131.html", + "doc_type":"sdkreference", + "p_code":"19", + "code":"20" + }, + { + "desc":"In a ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other develop", + "product_code":"modelarts", + "title":"Querying the List of Training Jobs", + "uri":"modelarts_04_0160.html", + "doc_type":"sdkreference", + "p_code":"19", + "code":"21" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the Details About a Training Job", + "uri":"modelarts_04_0161.html", + "doc_type":"sdkreference", + "p_code":"19", + "code":"22" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Modifying the Description of a Training Job", + "uri":"modelarts_04_0162.html", + "doc_type":"sdkreference", + "p_code":"19", + "code":"23" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Obtaining the Name of a Training Job Log File", + "uri":"modelarts_04_0163.html", + "doc_type":"sdkreference", + "p_code":"19", + "code":"24" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying Training Job Logs", + "uri":"modelarts_04_0164.html", + "doc_type":"sdkreference", + "p_code":"19", + "code":"25" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Deleting a Training Job", + "uri":"modelarts_04_0166.html", + "doc_type":"sdkreference", + "p_code":"19", + "code":"26" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Training Job Versions", + "uri":"modelarts_04_0167.html", + "doc_type":"sdkreference", + "p_code":"18", + "code":"27" + }, + { + "desc":"A training job must exist before you create a version for it. You can create a training job version based on Creating a Training Job or job_id and version_id of the objec", + "product_code":"modelarts", + "title":"Creating a Training Job Version", + "uri":"modelarts_04_0168.html", + "doc_type":"sdkreference", + "p_code":"27", + "code":"28" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the List of Training Job Versions", + "uri":"modelarts_04_0169.html", + "doc_type":"sdkreference", + "p_code":"27", + "code":"29" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the Details About a Training Job Version", + "uri":"modelarts_04_0170.html", + "doc_type":"sdkreference", + "p_code":"27", + "code":"30" + }, + { + "desc":"You can stop a training job version that is being created only when the job is running.In the ModelArts notebook instance, you do not need to enter authentication paramet", + "product_code":"modelarts", + "title":"Stopping a Training Job Version", + "uri":"modelarts_04_0171.html", + "doc_type":"sdkreference", + "p_code":"27", + "code":"31" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Deleting a Training Job Version", + "uri":"modelarts_04_0172.html", + "doc_type":"sdkreference", + "p_code":"27", + "code":"32" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Training Job Parameter Configuration", + "uri":"modelarts_04_0173.html", + "doc_type":"sdkreference", + "p_code":"18", + "code":"33" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Creating a Training Job Configuration", + "uri":"modelarts_04_0174.html", + "doc_type":"sdkreference", + "p_code":"33", + "code":"34" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the List of Training Job Parameter Configuration Objects", + "uri":"modelarts_04_0175.html", + "doc_type":"sdkreference", + "p_code":"33", + "code":"35" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the List of Training Job Configurations", + "uri":"modelarts_04_0176.html", + "doc_type":"sdkreference", + "p_code":"33", + "code":"36" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the Details About a Training Job Configuration", + "uri":"modelarts_04_0177.html", + "doc_type":"sdkreference", + "p_code":"33", + "code":"37" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Modifying a Training Job Configuration", + "uri":"modelarts_04_0178.html", + "doc_type":"sdkreference", + "p_code":"33", + "code":"38" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Deleting a Training Job Configuration", + "uri":"modelarts_04_0179.html", + "doc_type":"sdkreference", + "p_code":"33", + "code":"39" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Visualization Jobs", + "uri":"modelarts_04_0180.html", + "doc_type":"sdkreference", + "p_code":"18", + "code":"40" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Creating a Visualization Job", + "uri":"modelarts_04_0181.html", + "doc_type":"sdkreference", + "p_code":"40", + "code":"41" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the List of Visualization Job Objects", + "uri":"modelarts_04_0182.html", + "doc_type":"sdkreference", + "p_code":"40", + "code":"42" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the List of Visualization Jobs", + "uri":"modelarts_04_0183.html", + "doc_type":"sdkreference", + "p_code":"40", + "code":"43" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the Details About a Visualization Job", + "uri":"modelarts_04_0184.html", + "doc_type":"sdkreference", + "p_code":"40", + "code":"44" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Modifying the Description of a Visualization Job", + "uri":"modelarts_04_0185.html", + "doc_type":"sdkreference", + "p_code":"40", + "code":"45" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Stopping a Visualization Job", + "uri":"modelarts_04_0186.html", + "doc_type":"sdkreference", + "p_code":"40", + "code":"46" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Restarting a Visualization Job", + "uri":"modelarts_04_0187.html", + "doc_type":"sdkreference", + "p_code":"40", + "code":"47" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Deleting a Visualization Job", + "uri":"modelarts_04_0188.html", + "doc_type":"sdkreference", + "p_code":"40", + "code":"48" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Resource and Engine Specifications", + "uri":"modelarts_04_0189.html", + "doc_type":"sdkreference", + "p_code":"18", + "code":"49" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying a Built-in Algorithm", + "uri":"modelarts_04_0190.html", + "doc_type":"sdkreference", + "p_code":"49", + "code":"50" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the List of Resource Flavors", + "uri":"modelarts_04_0191.html", + "doc_type":"sdkreference", + "p_code":"49", + "code":"51" + }, + { + "desc":"In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other devel", + "product_code":"modelarts", + "title":"Querying the List of Engine Types", + "uri":"modelarts_04_0192.html", + "doc_type":"sdkreference", + "p_code":"49", + "code":"52" + }, + { + "desc":"Table 1 describes the job statuses.", + "product_code":"modelarts", + "title":"Job Statuses", + "uri":"modelarts_04_0077.html", + "doc_type":"sdkreference", + "p_code":"18", + "code":"53" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Model Management", + "uri":"modelarts_04_0193.html", + "doc_type":"sdkreference", + "p_code":"", + "code":"54" + }, + { + "desc":"The model import function covers the following aspects:Initialize the existing model and create a model object based on the model ID.Create a model. For details about the", + "product_code":"modelarts", + "title":"Importing a Model", + "uri":"modelarts_04_0194.html", + "doc_type":"sdkreference", + "p_code":"54", + "code":"55" + }, + { + "desc":"In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development enviro", + "product_code":"modelarts", + "title":"Obtaining the Model List", + "uri":"modelarts_04_0195.html", + "doc_type":"sdkreference", + "p_code":"54", + "code":"56" + }, + { + "desc":"In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development enviro", + "product_code":"modelarts", + "title":"Obtaining the Model Object List", + "uri":"modelarts_04_0196.html", + "doc_type":"sdkreference", + "p_code":"54", + "code":"57" + }, + { + "desc":"You can use the API to query the information about a model object.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authe", + "product_code":"modelarts", + "title":"Querying the Details About a Model", + "uri":"modelarts_04_0197.html", + "doc_type":"sdkreference", + "p_code":"54", + "code":"58" + }, + { + "desc":"You can use the API to delete a model object.In a ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details ", + "product_code":"modelarts", + "title":"Deleting a Model", + "uri":"modelarts_04_0198.html", + "doc_type":"sdkreference", + "p_code":"54", + "code":"59" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Service Management", + "uri":"modelarts_04_0199.html", + "doc_type":"sdkreference", + "p_code":"", + "code":"60" + }, + { + "desc":"Service management indicates deploying a model that has been successfully created as a real-time. This feature provides functions such as real-time prediction, service de", + "product_code":"modelarts", + "title":"Service Management Overview", + "uri":"modelarts_04_0200.html", + "doc_type":"sdkreference", + "p_code":"60", + "code":"61" + }, + { + "desc":"Real-time service deployment covers the following aspects:Initialize a real-time service.Deploy a real-time service predictor.Deploy a batch service transformer.The servi", + "product_code":"modelarts", + "title":"Deploying a Real-Time Service", + "uri":"modelarts_04_0201.html", + "doc_type":"sdkreference", + "p_code":"60", + "code":"62" + }, + { + "desc":"You can use the API to query details about a service object.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authenticat", + "product_code":"modelarts", + "title":"Querying the Details of a Service", + "uri":"modelarts_04_0203.html", + "doc_type":"sdkreference", + "p_code":"60", + "code":"63" + }, + { + "desc":"You can use the API to obtain the service list of a user.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication", + "product_code":"modelarts", + "title":"Querying the Service List", + "uri":"modelarts_04_0205.html", + "doc_type":"sdkreference", + "p_code":"60", + "code":"64" + }, + { + "desc":"You can use the API to obtain the service object list of a user.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authent", + "product_code":"modelarts", + "title":"Querying the List of Service Objects", + "uri":"modelarts_04_0206.html", + "doc_type":"sdkreference", + "p_code":"60", + "code":"65" + }, + { + "desc":"You can use the API to update the configurations of a service object.In ModelArts notebook, you do not need to enter authentication parameters for session authentication.", + "product_code":"modelarts", + "title":"Updating Service Configurations", + "uri":"modelarts_04_0207.html", + "doc_type":"sdkreference", + "p_code":"60", + "code":"66" + }, + { + "desc":"You can use the API to query the monitoring information about a service.In the ModelArts notebook instance, you do not need to enter authentication parameters for session", + "product_code":"modelarts", + "title":"Querying Service Monitoring Details", + "uri":"modelarts_04_0208.html", + "doc_type":"sdkreference", + "p_code":"60", + "code":"67" + }, + { + "desc":"You can use the API to query the logs of a service object.In the ModelArts notebook instance, you do not need to enter authentication parameters for session authenticatio", + "product_code":"modelarts", + "title":"Querying Service Logs", + "uri":"modelarts_04_0209.html", + "doc_type":"sdkreference", + "p_code":"60", + "code":"68" + }, + { + "desc":"You can delete a service in either of the following ways:Delete the service created in Deploying a Real-Time Service.Delete the service object returned in Querying the Li", + "product_code":"modelarts", + "title":"Delete a Service", + "uri":"modelarts_04_0211.html", + "doc_type":"sdkreference", + "p_code":"60", + "code":"69" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"modelarts", + "title":"Change History", + "uri":"modelarts_04_0099.html", + "doc_type":"sdkreference", + "p_code":"", + "code":"70" + } +] \ No newline at end of file diff --git a/docs/modelarts/sdk-ref/PARAMETERS.txt b/docs/modelarts/sdk-ref/PARAMETERS.txt new file mode 100644 index 00000000..6da8d5f0 --- /dev/null +++ b/docs/modelarts/sdk-ref/PARAMETERS.txt @@ -0,0 +1,3 @@ +version="" +language="en-us" +type="" \ No newline at end of file diff --git a/docs/modelarts/sdk-ref/en-us_image_0000001455263253.jpg b/docs/modelarts/sdk-ref/en-us_image_0000001455263253.jpg new file mode 100644 index 00000000..b0e263d9 Binary files /dev/null and b/docs/modelarts/sdk-ref/en-us_image_0000001455263253.jpg differ diff --git a/docs/modelarts/sdk-ref/modelarts_04_0001.html b/docs/modelarts/sdk-ref/modelarts_04_0001.html new file mode 100644 index 00000000..dbc471ce --- /dev/null +++ b/docs/modelarts/sdk-ref/modelarts_04_0001.html @@ -0,0 +1,46 @@ + + +
This document describes how to install and configure a development environment and call functions provided by ModelArts SDK for secondary development.
+ +Section + |
+Description + |
+
---|---|
+ | +Concepts of ModelArts SDK + |
+
+ + + | +How to make preparations for secondary development using ModelArts SDK + |
+
+ | +How to authenticate resources and initialize ModelArts SDK Client and OBS Client + |
+
+ | +How to call the SDK APIs of Object Storage Service (OBS), including the APIs for creating OBS buckets, uploading and downloading files and folders, as well as deleting OBS objects and buckets + |
+
ModelArts SDK operations: + + + + |
+Common operations using ModelArts SDK + |
+
ModelArts Software Development Kit (ModelArts SDK) encapsulates the ModelArts RESTful APIs in Python language to simplify application development. You can directly call ModelArts SDK to easily manage datasets, start AI training, generate models, and deploy the models.
+ModelArts SDK supports only the Python language, including Python 2.7, Python 3.6, Python 3.7, and later versions.
+Download the ModelArts SDK software package of the latest version.
+After the SDK is downloaded, you can use pip to install it. For details about how to install pip, see the pip official website. To install the ModelArts SDK, run the following command:
+pip install modelarts-latest-py2.py3-none-any.whl
+certifi >= 14.05.14 +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 +requests >= 2.19.1 +esdk-obs-python == 3.0.5 +Flask==1.0.2 +Flask-Cors==3.0.4 +gunicorn==19.8.1 +mxnet-model-server==0.3 +psutil==5.4.6 +prometheus_client==0.3.1+
If an error message is displayed during the installation, indicating that a required dependency package is missing, run the following command to install the dependency package as prompted. In the command, xxxx indicates the name of the dependency package.
+pip install xxxx
+ModelArts SDK can be used in the following environments:
+On the ModelArts management console, access the DevEnviron module, create a notebook instance, and directly call the ModelArts SDK APIs in the Terminal or Ipynb file. You can call the SDK in a notebook instance to perform operations such as OBS management, job management, model management, and service management by referring to the API reference.
+Download and install Python 2 or Python 3 from the official website of Python (Python 2.7, Python 3.6, Python 3.7, or later is recommended), and configure a Python runtime environment.
+When calling APIs, you need to specify the project ID in certain URLs. To do so, you need to obtain the project ID first. To obtain a project ID, perform the following operations:
+On the My Credential page, view project IDs in the project list.
+Table 1 describes the job statuses.
+ +Status Value + |
+Description + |
+
---|---|
0 + |
+JOBSTAT_UNKNOWN: Unknown status. + |
+
1 + |
+JOBSTAT_INIT: The job is being initialized. + |
+
2 + |
+JOBSTAT_IMAGE_CREATING: The job image is being created. + |
+
3 + |
+JOBSTAT_IMAGE_FAILED: Failed to create the job image. + |
+
4 + |
+JOBSTAT_SUBMIT_TRYING: The job is being submitted. + |
+
5 + |
+JOBSTAT_SUBMIT_FAILED: Failed to submit the job. + |
+
6 + |
+JOBSTAT_DELETE_FAILED: Failed to delete the job. + |
+
7 + |
+JOBSTAT_WAITING: The job is queuing. + |
+
8 + |
+JOBSTAT_RUNNING: The job is running. + |
+
9 + |
+JOBSTAT_KILLING: The job is being canceled. + |
+
10 + |
+JOBSTAT_COMPLETED: The job has been completed. + |
+
11 + |
+JOBSTAT_FAILED: Failed to run the job. + |
+
12 + |
+JOBSTAT_KILLED: Job canceled successfully. + |
+
13 + |
+JOBSTAT_CANCELED: Job canceled. + |
+
14 + |
+JOBSTAT_LOST: Job lost. + |
+
15 + |
+JOBSTAT_SCALING: The job is being scaled. + |
+
16 + |
+JOBSTAT_SUBMIT_MODEL_FAILED: Failed to submit the model. + |
+
17 + |
+JOBSTAT_DEPLOY_SERVICE_FAILED: Failed to deploy the service. + |
+
18 + |
+JOBSTAT_CHECK_INIT: The job review is being initialized. + |
+
19 + |
+JOBSTAT_CHECK_RUNNING: The job is being reviewed. + |
+
20 + |
+JOBSTAT_CHECK_RUNNING_COMPLETED: The approval job is completed. + |
+
21 + |
+JOBSTAT_CHECK_FAILED: Failed to review the job. + |
+
22 + |
+MOUNT_FAILED: Failed to mount. + |
+
Released On + |
+Description + |
+
---|---|
2022-11-17 + |
+This is the first official release. + |
+
The session module authenticates in-cloud resources and initializes ModelArts SDK Client and OBS Client. After a session is set up, you can directly call the ModelArts SDK APIs.
+1 +2 | from modelarts.session import Session +session = Session() + |
For training on the training platform, if the training fails, you can view the detailed log information on the platform or by calling the API in Querying Training Job Logs.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + framework_type='PyTorch', # AI engine name + framework_version='PyTorch-1.0.0-python3.6', # AI engine version + code_dir='/bucket/src/', # Training script directory + boot_file='/bucket/src/pytorch_sentiment.py', # Training boot script directory + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.cpu.2u', # Training environment flavor + train_instance_count=1, # Number of training nodes + job_description='pytorch-sentiment with ModelArts SDK') # Training job description +job_instance = estimator.fit(inputs='/bucket/data/train/', wait=False, job_name='my_training_job') + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + framework_type='PyTorch', # AI engine name + framework_version='PyTorch-1.0.0-python3.6', # AI engine version + code_dir='/bucket/src/', # Training script directory + boot_file='/bucket/src/pytorch_sentiment.py', # Training boot script directory + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.cpu.2u', # Training environment flavor + train_instance_count=1, # Number of training nodes + job_description='pytorch-sentiment with ModelArts SDK') # Training job description +job_instance = estimator.fit(dataset_id='4AZNvFkN7KYr5EdhFkH', dataset_version_id='UOF9BIeSGArwVt0oI6T', wait=False, job_name='my_training_job') + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.cpu.2u', # Training environment flavor + train_instance_count=1, # Number of training nodes + user_command='bash -x /home/work/run_train.sh python /home/work/user-job-dir/app/mnist/mnist_softmax.py --data_url /home/work/user-job-dir/app/mnist_data', # Boot command of the custom image + user_image_url='100.125.5.235:20202/jobmng/cpu-base:1.0', # Address for downloading the custom image + job_description='pytorch-sentiment with ModelArts SDK') # Training job description +job_instance = estimator.fit(inputs='/bucket/data/train/', wait=False, job_name='my_training_job') + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
train_instance_count + |
+Yes + |
+Long + |
+Number of compute nodes in a training job + |
+
code_dir + |
+No + |
+String + |
+Code directory of a training job, for example, /bucket/src/. Leave this parameter blank when model_name is set. + |
+
boot_file + |
+No + |
+String + |
+Boot file of a training job, which needs to be stored in the code directory. For example, /bucket/src/boot.py. Leave this parameter blank when model_name is set. + |
+
output_path + |
+Yes + |
+String + |
+Output path of a training job + |
+
hyperparameters + |
+No + |
+JSON Array + |
+Running parameters of a training job. It is a collection of label-value pairs of the string type. This parameter is a container environment variable when a job uses a custom image. + |
+
log_url + |
+No + |
+String + |
+OBS URL of the logs of a training job. By default, this parameter is left blank. Example value: /usr/log/ + |
+
train_instance_type + |
+Yes + |
+Long + |
+Resource flavor selected for a training job. If you choose to train on the training platform, obtain the value by calling the API described in Querying the List of Resource Flavors. + |
+
framework_type + |
+No + |
+String + |
+Engine selected for a training job. Obtain the value by calling the API described in Querying the List of Engine Types. Leave this parameter blank when model_name is set. + |
+
framework_version + |
+No + |
+String + |
+Engine version selected for a training job. Obtain the value by calling the API described in Querying the List of Engine Types. Leave this parameter blank when model_name is set. + |
+
job_description + |
+No + |
+String + |
+Description of a training job + |
+
user_image_url + |
+No + |
+String + |
+SWR URL of the custom image used by a training job. Example value: 100.125.5.235:20202/jobmng/custom-cpu-base:1.0 + |
+
user_command + |
+No + |
+String + |
+Boot command used to start the container of the custom image of a training job. The format is bash /home/work/run_train.sh python /home/work/user-job-dir/app/train.py {python_file_parameter}. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
inputs + |
+Yes + |
+String + |
+Data storage location of a training job. +inputs cannot be used with dataset_id and dataset_version_id, or with data_source at the same time. However, one of the parameters must exist. +Only this parameter is supported in local training. + |
+
dataset_id + |
+No + |
+String + |
+Dataset ID of a training job. To obtain the dataset ID, view basic information about the dataset. +This parameter must be used together with dataset_version_id, but cannot be used together with inputs. + |
+
dataset_version_id + |
+No + |
+String + |
+Dataset version ID of a training job. To obtain the dataset version ID, view basic information about the dataset. +This parameter must be used together with dataset_id, but cannot be used together with inputs. + |
+
wait + |
+No + |
+Boolean + |
+Whether to wait for the completion of a training job. Default value: False + |
+
job_name + |
+No + |
+String + |
+Name of a training job, consisting of 1 to 64 alphanumeric characters. If this parameter is left blank, a job name is generated randomly. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
TrainingJob + |
+Object + |
+Training object. This object contains attributes such as job_id and version_id, and operations on a training job, such as querying, modifying, or deleting the training job. For example, you can use job_instance.job_id to obtain the ID of a training job. + |
+
This authentication method is available for OBS Management, Training Management, Model Management, and Service Management.
+1 +2 +3 +4 +5 +6 +7 | from modelarts.session import Session +# Set endpoint +Session.set_endpoint(iam_endpoint='***', + obs_endpoint='***', + modelarts_endpoint='***', + region_name='***') +session = Session(account='***', username='***', password='***', region_name='***', project_id='***') + |
This authentication method is available for OBS Management, Training Management, Model Management, and Service Management.
+1 +2 +3 +4 +5 +6 +7 | from modelarts.session import Session +# Set endpoint +Session.set_endpoint(iam_endpoint='***', + obs_endpoint='***', + modelarts_endpoint='***', + region_name='***') +session = Session(access_key='***',secret_key='***', project_id='***', region_name='***') + |
Parameters in this command are described as follows:
+In a ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +job_list_info = Estimator.get_job_list(modelarts_session=session, status=8, per_page=10, page=1, order="asc", search_content="job") + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
status + |
+No + |
+Integer + |
+Job status to be queried. By default, jobs of all statuses are queried. For example, to view jobs that fail to be created, set this parameter to 3, 5, 6, or 13. For details about the job statuses, see Job Statuses. + |
+
per_page + |
+No + |
+Integer + |
+Number of jobs displayed on each page. The value range is [1, 1000]. Default value: 10 + |
+
page + |
+No + |
+Integer + |
+Index of the page to be queried. Default value: 1 + |
+
sortBy/sort_by + |
+No + |
+String + |
+When AK/SK-based authentication is used, the parameter name is sortBy. When account-based authentication is used, the parameter name is sort_by. The parameter specifies the sorting mode of the query. The value can be job_name, job_desc, status, duration, engine_type, or create_time. Default value: job_name + |
+
order + |
+No + |
+String + |
+The options are as follows: +
|
+
search_content + |
+No + |
+String + |
+Search content, for example, a training job name. The value is a string of 0 to 100 characters. By default, this parameter is left blank. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
job_total_count + |
+Integer + |
+Total number of created jobs + |
+
job_count_limit + |
+Integer + |
+Number of training jobs that can be created + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
quotas + |
+Integer + |
+Maximum number of training jobs + |
+
jobs + |
+JSON Array + |
+Attributes of a training job. For details, see Table 3. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
job_id + |
+Long + |
+Training job ID + |
+
job_name + |
+String + |
+Training job name + |
+
version_id + |
+Long + |
+Version ID of a training job + |
+
status + |
+Byte + |
+Status of a training job. For details about the job statuses, see Job Statuses. + |
+
create_time + |
+Long + |
+Timestamp when a training job is created + |
+
duration + |
+Long + |
+Training job running duration, in milliseconds + |
+
job_desc + |
+String + |
+Description of a training job + |
+
version_count + |
+Long + |
+Number of versions of a training job + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(modelarts_session=session, job_id="182626", version_id="278813") +job_info = estimator.get_job_info() + |
1 | job_info = job_instance.get_job_info() + |
1 | job_info = job_version_instance_list[0].get_job_info() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
version_id + |
+Yes + |
+String + |
+Version ID of a training job. You can query version_id using the training job object generated in Creating a Training Job, for example, job_instance.version_id, or from the response obtained in Querying the List of Training Jobs. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
job_id + |
+Long + |
+Training job ID + |
+
job_name + |
+String + |
+Training job name + |
+
job_desc + |
+String + |
+Description of a training job + |
+
version_id + |
+Long + |
+Version ID of a training job + |
+
version_name + |
+String + |
+Version name of a training job + |
+
pre_version_id + |
+Long + |
+Name of the previous version of a training job + |
+
engine_type + |
+Short + |
+Engine type of a training job. The mapping between engine_type and engine_name is as follows: +
|
+
engine_name + |
+String + |
+Name of the engine selected for a training job. Currently, the following engines are supported: +
|
+
engine_id + |
+Long + |
+ID of the engine selected for a training job + |
+
engine_version + |
+String + |
+Version of the engine selected for a training job + |
+
status + |
+Integer + |
+Status of a training job. For details about the job statuses, see Job Statuses. + |
+
app_url + |
+String + |
+Code directory of a training job + |
+
boot_file_url + |
+String + |
+Boot file of a training job + |
+
create_time + |
+Long + |
+Time when a training job is created + |
+
parameter + |
+JSON Array + |
+Running parameters of a training job. It is a collection of label-value pairs. This parameter is a container environment variable when a job uses a custom image. + |
+
duration + |
+Long + |
+Training job running duration, in milliseconds + |
+
spec_id + |
+Long + |
+ID of the resource specifications selected for a training job + |
+
core + |
+String + |
+Number of cores of the resource specifications + |
+
cpu + |
+String + |
+CPU memory of the resource specifications + |
+
gpu_num + |
+Integer + |
+Number of GPUs of the resource specifications + |
+
gpu_type + |
+String + |
+GPU type of the resource specifications + |
+
worker_server_num + |
+Integer + |
+Number of workers in a training job + |
+
data_url + |
+String + |
+Dataset of a training job + |
+
train_url + |
+String + |
+OBS path to the training job output file + |
+
dataset_version_id + |
+String + |
+Dataset version ID of a training job + |
+
dataset_id + |
+String + |
+Dataset ID of a training job + |
+
data_source + |
+JSON Array + |
+Datasets of a training job + |
+
model_id + |
+Long + |
+Model ID of a training job + |
+
model_metric_list + |
+JSON Array + |
+Model metrics of a training job + |
+
system_metric_list + |
+JSON Array + |
+System monitoring metrics of a training job + |
+
user_image_url + |
+String + |
+SWR URL of the custom image used by a training job + |
+
user_command + |
+String + |
+Boot command used to start the container of the custom image of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
dataset_id + |
+String + |
+Dataset ID of a training job + |
+
dataset_version + |
+String + |
+Dataset version ID of a training job + |
+
type + |
+String + |
+Dataset type +obs: Data from OBS is used. +dataset: Data from a specified dataset is used. + |
+
data_url + |
+String + |
+OBS bucket path + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
metric + |
+JSON Array + |
+Validation metrics of a class of a training job + |
+
total_metric + |
+JSON Array + |
+All validation metrics of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
cpuUsage + |
+JSON Array + |
+CPU usage of a training job + |
+
memUsage + |
+JSON Array + |
+Memory usage of a training job + |
+
gpuUtil + |
+JSON Array + |
+GPU usage of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
metric_values + |
+JSON Array + |
+Validation metrics of a class of a training job + |
+
reserved_data + |
+JSON Array + |
+Reserved parameter + |
+
metric_meta + |
+JSON Array + |
+A class of a training job, including the class ID and name + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
recall + |
+JSON Array + |
+Recall of a class of a training job + |
+
precision + |
+JSON Array + |
+Precision of a class of a training job + |
+
accuracy + |
+JSON Array + |
+Accuracy of a class of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
total_metric_meta + |
+JSON Array + |
+Reserved parameter + |
+
total_reserved_data + |
+JSON Array + |
+Reserved parameter + |
+
total_metric_values + |
+JSON Array + |
+All validation metrics of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
f1_score + |
+Float + |
+F1 score of a training job + |
+
recall + |
+Float + |
+Total recall of a training job + |
+
precision + |
+Float + |
+Total precision of a training job + |
+
accuracy + |
+Float + |
+Total accuracy of a training job + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(modelarts_session=session, job_id="182626") +job_description = estimator.update_job_description(description='update description') + |
1 | job_description = job_instance.update_job_description(description='update description') + |
1 | job_description = job_version_instance_list[0].update_job_description(description='update description') + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
description + |
+Yes + |
+String + |
+Description of the training job to be modified + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(modelarts_session=session, job_id="182626", version_id="278813") +job_log_list = estimator.get_job_log_file_list() + |
1 | job_log_list = job_instance.get_job_log_file_list() + |
1 | job_log_list = job_version_instance_list[0].get_job_log_file_list() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
version_id + |
+Yes + |
+String + |
+Version ID of a training job. You can query version_id using the training job object generated in Creating a Training Job, for example, job_instance.version_id, or from the response obtained in Querying the List of Training Jobs. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
log_file_list + |
+List + |
+Log file name of a training job. A single-node job has only one log file, and a distributed job has multiple log files. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(modelarts_session=session, job_id="182626", version_id="278813") +job_log = estimator.get_job_log(log_file='job-job-0713-191758.0') + |
1 | job_log = job_instance.get_job_log(log_file='job-job-0713-191758.0') + |
1 | job_log = job_version_instance_list[0].get_job_log(log_file='job-job-0713-191758.0') + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
version_id + |
+Yes + |
+String + |
+Version ID of a training job. You can query version_id using the training job object generated in Creating a Training Job, for example, job_instance.version_id, or from the response obtained in Querying the List of Training Jobs. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
log_file + |
+Yes + |
+String + |
+Name of a training job log file + |
+
start_byte + |
+No + |
+Long + |
+Start position for obtaining the log. The default value is 0. The value range is [-1, +∞]. If the value is -1, the log with the latest offset is obtained. + |
+
offset + |
+No + |
+Long + |
+Length of the obtained log. The default value is 2048. The value range is [-2048, 2048]. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
content + |
+String + |
+Content of the requested log + |
+
lines + |
+Integer + |
+Number of lines in the log + |
+
start_line + |
+String + |
+Start position of the obtained log + |
+
end_line + |
+String + |
+End position of the obtained log + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +Estimator.delete_job_by_id(modelarts_session=session, job_id="155500") + |
Method 2: Delete the training job created in Creating a Training Job.
+1 | status = job_instance.delete_job() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API call fails. +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
A training job must exist before you create a version for it. You can create a training job version based on Creating a Training Job or job_id and version_id of the object returned by Querying the List of Training Job Versions.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + framework_type='PyTorch', # AI engine name + framework_version='PyTorch-1.0.0-python3.6', # AI engine version + code_dir='/bucket/src/', # Training script directory + boot_file='/bucket/src/pytorch_sentiment.py', # Training boot script directory + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.gpu.p100', # Training environment flavor + train_instance_count=1) +job_version_instance = estimator.create_job_version(job_id='182626', pre_version_id=278813, inputs='/bucket/data/train/', wait=False, job_desc='create a job version') + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + framework_type='PyTorch', # AI engine name + framework_version='PyTorch-1.0.0-python3.6', # AI engine version + code_dir='/bucket/src/', # Training script directory + boot_file='/bucket/src/pytorch_sentiment.py', # Training boot script directory + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.gpu.p100', # Training environment flavor + train_instance_count=1, # Number of training nodes + job_description='pytorch-sentiment with ModelArts SDK') # Training job description +job_version_instance = estimator.create_job_version(job_id='182626', pre_version_id=278813, inputs='/bucket/data/train/', wait=False, job_desc='create a job version') + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.gpu.p100', # Training environment flavor + train_instance_count=1, # Number of training nodes + user_command='bash -x /home/work/run_train.sh python /home/work/user-job-dir/app/mnist/mnist_softmax.py --data_url /home/work/user-job-dir/app/mnist_data', # Boot command of the custom image + user_image_url='100.125.5.235:20202/jobmng/cpu-base:1.0', # Address for downloading the custom image + job_description='pytorch-sentiment with ModelArts SDK') # Training job description +job_version_instance = estimator.create_job_version(job_id='182626', pre_version_id=278813, inputs='/bucket/data/train/', wait=False, job_desc='create a job version') + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
train_instance_count + |
+Yes + |
+Long + |
+Number of workers in a training job + |
+
code_dir + |
+No + |
+String + |
+Code directory of a training job, for example, /bucket/src/. Leave this parameter blank when model_name is set. + |
+
boot_file + |
+No + |
+String + |
+Boot file of a training job, which needs to be stored in the code directory. For example, /bucket/src/boot.py. Leave this parameter blank when model_name is set. + |
+
output_path + |
+Yes + |
+String + |
+Output path of a training job + |
+
hyperparameters + |
+No + |
+JSON Array + |
+Running parameters of a training job. It is a collection of label-value pairs of the string type. This parameter is a container environment variable when a job uses a custom image. + |
+
log_url + |
+No + |
+String + |
+OBS URL of the logs of a training job. By default, this parameter is left blank. Example value: /usr/log/ + |
+
train_instance_type + |
+Yes + |
+Long + |
+Resource flavor selected for a training job. If you choose to train on the training platform, obtain the value by calling the API described in Querying the List of Resource Flavors. + |
+
framework_type + |
+No + |
+String + |
+Engine selected for a training job. Obtain the value by calling the API described in Querying the List of Engine Types. Leave this parameter blank when model_name is set. + |
+
framework_version + |
+No + |
+String + |
+Engine version selected for a training job. Obtain the value by calling the API described in Querying the List of Engine Types. Leave this parameter blank when model_name is set. + |
+
user_image_url + |
+No + |
+String + |
+SWR URL of the custom image used by a training job. Example value: 100.125.5.235:20202/jobmng/custom-cpu-base:1.0 + |
+
user_command + |
+No + |
+String + |
+Boot command used to start the container of the custom image of a training job. The format is bash /home/work/run_train.sh python /home/work/user-job-dir/app/train.py {python_file_parameter}. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
pre_version_id + |
+Yes + |
+Long + |
+ID of the previous version of a training job. You can query pre_version_id using the training job object generated in Creating a Training Job, for example, job_instance.version_id, or from the response obtained in Querying the List of Training Jobs. + |
+
inputs + |
+Yes + |
+String + |
+Data storage location of a training job. inputs cannot be used with dataset_id and dataset_version_id, or with data_source at the same time. However, one of the parameters must exist. Only this parameter is supported in local training. + |
+
dataset_id + |
+No + |
+String + |
+Dataset ID of a training job. This parameter must be used together with dataset_version_id, but cannot be used together with inputs. To obtain the dataset ID, view basic information about the dataset. + |
+
dataset_version_id + |
+No + |
+String + |
+Dataset version ID of a training job. This parameter must be used together with dataset_id, but cannot be used together with inputs. To obtain the dataset version ID, view basic information about the dataset. + |
+
wait + |
+No + |
+Boolean + |
+Whether to wait for the completion of creating a training job version. Default value: False + |
+
job_desc + |
+No + |
+String + |
+Description of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
TrainingJob + |
+Object + |
+Training object. This object contains attributes such as job_id and version_id, and operations on a training job, such as querying, modifying, or deleting the training job. For example, you can use job_version_instance.job_id to obtain the ID of a training job. + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(session, job_id="182626") +job_version_instance_list = estimator.get_job_version_object_list() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
is_show + |
+No + |
+Boolean + |
+Whether to print the training job version details. Default value: True + |
+
A training object list is returned in the successful response to get_job_version_object_list. For details, see Table 3.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
TrainingJob + |
+Object + |
+Training object. This object contains attributes such as job_id and version_id, and operations on a training job, such as querying, modifying, or deleting the training job. For example, you can use job_version_instance.job_id to obtain the ID of a training job. + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(session, job_id="182626") +job_version_info = estimator.get_job_version_info() + |
1 | job_version_info = job_version_instance.get_job_version_info() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
job_id + |
+Long + |
+Training job ID + |
+
job_name + |
+String + |
+Training job name + |
+
job_desc + |
+String + |
+Description of a training job + |
+
version_count + |
+Long + |
+Number of versions of a training job + |
+
versions + |
+JSON Array + |
+Version parameters of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
version_id + |
+Long + |
+Version ID of a training job + |
+
version_name + |
+String + |
+Version name of a training job + |
+
pre_version_id + |
+Long + |
+ID of the previous version of a training job + |
+
engine_type + |
+Long + |
+Engine type of a training job + |
+
engine_id + |
+Long + |
+ID of the engine selected for a training job + |
+
engine_version + |
+String + |
+Version of the engine selected for a training job + |
+
status + |
+Integer + |
+Status of a training job + |
+
app_url + |
+String + |
+Code directory of a training job + |
+
boot_file_url + |
+String + |
+Boot file of a training job + |
+
create_time + |
+Long + |
+Time when a training job is created + |
+
parameter + |
+JSON Array + |
+Running parameters of a training job. It is a collection of label-value pairs. This parameter is a container environment variable when a job uses a custom image. + |
+
duration + |
+Long + |
+Training job running duration, in milliseconds + |
+
spec_id + |
+Long + |
+ID of the resource specifications selected for a training job + |
+
core + |
+String + |
+Number of cores of the resource specifications + |
+
cpu + |
+String + |
+CPU memory of the resource specifications + |
+
gpu_num + |
+Integer + |
+Number of GPUs of the resource specifications + |
+
gpu_type + |
+String + |
+GPU type of the resource specifications + |
+
worker_server_num + |
+Integer + |
+Number of workers in a training job + |
+
data_url + |
+String + |
+Dataset of a training job + |
+
train_url + |
+String + |
+OBS path to the training job output file + |
+
log_url + |
+String + |
+OBS URL of the logs of a training job. By default, this parameter is left blank. Example value: /usr/log/ + |
+
dataset_version_id + |
+String + |
+Dataset version ID of a training job + |
+
dataset_id + |
+String + |
+Dataset ID of a training job + |
+
data_source + |
+JSON Array + |
+Datasets of a training job + |
+
model_id + |
+String + |
+Model ID of a training job + |
+
model_metric_list + |
+JSON Array + |
+Model metrics of a training job + |
+
system_metric_list + |
+JSON Array + |
+System monitoring metrics of a training job + |
+
user_image_url + |
+String + |
+SWR URL of the custom image used by a training job + |
+
user_command + |
+String + |
+Boot command used to start the container of the custom image of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
dataset_id + |
+String + |
+Dataset ID of a training job + |
+
dataset_version + |
+String + |
+Dataset version ID of a training job + |
+
type + |
+String + |
+Dataset type +obs: Data from OBS is used. +dataset: Data from a specified dataset is used. + |
+
data_url + |
+String + |
+OBS bucket path + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
metric + |
+JSON Array + |
+Validation metrics of a class of a training job + |
+
total_metric + |
+JSON Array + |
+All validation metrics of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
cpuUsage + |
+JSON Array + |
+CPU usage of a training job + |
+
memUsage + |
+JSON Array + |
+Memory usage of a training job + |
+
gpuUtil + |
+JSON Array + |
+GPU usage of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
metric_values + |
+JSON Array + |
+Validation metrics of a class of a training job + |
+
reserved_data + |
+JSON Array + |
+Reserved parameter + |
+
metric_meta + |
+JSON Array + |
+A class of a training job, including the class ID and name + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
recall + |
+JSON Array + |
+Recall of a class of a training job + |
+
precision + |
+JSON Array + |
+Precision of a class of a training job + |
+
accuracy + |
+JSON Array + |
+Accuracy of a class of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
total_metric_meta + |
+JSON Array + |
+Reserved parameter + |
+
total_reserved_data + |
+JSON Array + |
+Reserved parameter + |
+
total_metric_values + |
+JSON Array + |
+All validation metrics of a training job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
f1_score + |
+Float + |
+F1 score of a training job + |
+
recall + |
+Float + |
+Total recall of a training job + |
+
precision + |
+Float + |
+Total precision of a training job + |
+
accuracy + |
+Float + |
+Total accuracy of a training job + |
+
You can stop a training job version that is being created only when the job is running.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(session, job_id="182626", version_id="278813") +status = estimator.stop_job_version() + |
1 | status = job_version_instance.stop_job_version() + |
1 | status = job_version_instance_list[0].stop_job_version() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
version_id + |
+Yes + |
+String + |
+Version ID of a training job. You can query version_id from the response obtained in Querying the List of Training Job Versions. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(session, job_id="182626", version_id="278813") +status = estimator.delete_job_version() + |
1 | status = job_version_instance.delete_job_version() + |
1 | status = job_version_instance_list[0].delete_job_version() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
job_id + |
+Yes + |
+String + |
+ID of a training job. You can query job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response obtained in Querying the List of Training Jobs. + |
+
version_id + |
+Yes + |
+String + |
+Version ID of a training job. You can query version_id from the response obtained in Querying the List of Training Job Versions. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + framework_type='PyTorch', # AI engine name + framework_version='PyTorch-1.0.0-python3.6', # AI engine version + code_dir='/bucket/src/', # Training script directory + boot_file='/bucket/src/pytorch_sentiment.py', # Training boot script directory + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.gpu.p100', # Training environment flavor + train_instance_count=1) # Number of training nodes +job_config_instance = estimator.create_job_configs(config_name='my_job_config', inputs='/bucket/data/train/', config_desc='my job config') + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + framework_type='PyTorch', # AI engine name + framework_version='PyTorch-1.0.0-python3.6', # AI engine version + code_dir='/bucket/src/', # Training script directory + boot_file='/bucket/src/pytorch_sentiment.py', # Training boot script directory + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.gpu.p100', # Training environment flavor + train_instance_count=1) # Number of training nodes +job_config_instance = estimator.create_job_configs(config_name='my_job_config', dataset_id='4AZNvFkN7KYr5EdhFkH', dataset_version_id='UOF9BIeSGArwVt0oI6T', config_desc='my job config') + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
train_instance_count + |
+Yes + |
+Long + |
+Number of workers in a training job + |
+
code_dir + |
+No + |
+String + |
+Code directory of a training job, for example, /bucket/src/. Leave this parameter blank when model_name is set. + |
+
boot_file + |
+No + |
+String + |
+Boot file of a training job, which needs to be stored in the code directory. For example, /bucket/src/boot.py. Leave this parameter blank when model_name is set. + |
+
model_name + |
+No + |
+Long + |
+Name of the built-in algorithm used by a training job. If you have configured model_name, you do not need to configure app_url, boot_file_url, framework_type, and framework_version. + |
+
output_path + |
+Yes + |
+String + |
+Output path of a training job + |
+
hyperparameters + |
+No + |
+JSON Array + |
+Running parameters of a training job. It is a collection of label-value pairs. This parameter is a container environment variable when a job uses a custom image. + |
+
log_url + |
+No + |
+String + |
+OBS URL of the logs of a training job. By default, this parameter is left blank. Example value: /usr/log/ + |
+
train_instance_type + |
+Yes + |
+Long + |
+Resource flavor selected for a training job. If you choose to train on the training platform, obtain the value by calling the API described in Querying the List of Resource Flavors. + |
+
framework_type + |
+No + |
+String + |
+Engine selected for a training job. Obtain the value by calling the API described in Querying the List of Engine Types. Leave this parameter blank when model_name is set. + |
+
framework_version + |
+No + |
+String + |
+Engine version selected for a training job. Obtain the value by calling the API described in Querying the List of Engine Types. Leave this parameter blank when model_name is set. + |
+
job_description + |
+No + |
+String + |
+Description of a training job + |
+
user_image_url + |
+No + |
+String + |
+SWR URL of the custom image used by a training job. Example value: 100.125.5.235:20202/jobmng/custom-cpu-base:1.0 + |
+
user_command + |
+No + |
+String + |
+Boot command used to start the container of the custom image of a training job. The format is bash /home/work/run_train.sh python /home/work/user-job-dir/app/train.py {python_file_parameter}. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
config_name + |
+No + |
+String + |
+Name of a training job parameter configuration. The value is a string of 1 to 20 characters consisting of only digits, letters, underscores (_), and hyphens (-). By default, if this parameter is left blank, the value is dynamically generated by date. + |
+
config_desc + |
+No + |
+String + |
+Description of a training job parameter configuration. The value is a string of 0 to 256 characters. By default, this parameter is left blank. + |
+
inputs + |
+No + |
+String + |
+OBS storage path of a training job + |
+
dataset_id + |
+No + |
+String + |
+Dataset ID of a training job. This parameter must be used together with dataset_version_id, but cannot be used together with inputs. + |
+
dataset_version_id + |
+No + |
+String + |
+Dataset version ID of a training job. This parameter must be used together with dataset_id, but cannot be used together with inputs. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
TrainingJob + |
+Object + |
+Training object. This object contains attributes such as config_name, and operations on a training job parameter configuration, such as querying or deleting the training job parameter configuration. For example, you can use job_config_instance.config_name to obtain the name of a training job parameter configuration. + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +job_config_instance_list = Estimator.get_job_configs_object_list(modelarts_session=session, is_show=True, per_page=10, page=1, sort_by="create_time", order="asc", search_content="configname") + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
per_page + |
+No + |
+Integer + |
+Number of job parameters displayed on each page. The value range is [1, 1000]. Default value: 10 + |
+
page + |
+No + |
+Integer + |
+Index of the page to be queried. Default value: 1 + |
+
sortBy/sort_by + |
+No + |
+String + |
+When AK/SK-based authentication is used, the parameter name is sortBy. When the username and password are used for authentication, the parameter name is sort_by. The parameter specifies the sorting mode of the query. The value can be job_name, job_desc, status, duration, engine_type, or create_time. Default value: job_name + |
+
order + |
+No + |
+String + |
+Sorting order. The options are as follows: +
|
+
search_content + |
+No + |
+String + |
+Search content, for example, a parameter name. By default, this parameter is left blank. + |
+
is_show + |
+No + |
+Boolean + |
+Whether to print the training job parameter configuration list. Default value: True + |
+
A training object list is returned in the successful response to get_job_configs_object_list. For details, see Table 2.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
TrainingJob + |
+Object + |
+Training object. This object contains attributes such as config_name, and operations on a training job parameter configuration, such as querying or deleting the training job parameter configuration. For example, you can use job_config_instance.config_name to obtain the name of a training job parameter configuration. + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +job_paras_list = Estimator.get_job_configs_list(modelarts_session=session, per_page=10, page=1, sort_by="create_time", order="asc", search_content="configname") + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
per_page + |
+No + |
+Integer + |
+Number of job parameters displayed on each page. The value range is [1, 1000]. Default value: 10 + |
+
page + |
+No + |
+Integer + |
+Index of the page to be queried. Default value: 1 + |
+
sortBy/sort_by + |
+No + |
+String + |
+When AK/SK-based authentication is used, the parameter name is sortBy. When account-based authentication is used, the parameter name is sort_by. The parameter specifies the sorting mode of the query. The value can be job_name, job_desc, status, duration, engine_type, or create_time. Default value: job_name + |
+
order + |
+No + |
+String + |
+Sorting order. The options are as follows: +
|
+
search_content + |
+No + |
+String + |
+Search content, for example, a parameter name. By default, this parameter is left blank. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
config_total_count + |
+Integer + |
+Total number of the queried training job configurations + |
+
configs + |
+JSON Array + |
+configs parameters + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
config_name + |
+String + |
+Name of a training job parameter configuration + |
+
config_desc + |
+String + |
+Description of a training job parameter configuration + |
+
create_time + |
+Long + |
+Time when a training job is created + |
+
engine_type + |
+Short + |
+Engine type of a training job + |
+
engine_name + |
+String + |
+Name of the engine selected for a training job + |
+
engine_id + |
+Long + |
+ID of the engine selected for a training job + |
+
engine_version + |
+String + |
+Version of the engine selected for a training job + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(modelarts_session=session, config_name="my_job_config") +job_paras_info = estimator.get_job_configs_info() + |
1 | job_paras_info = job_config_instance.get_job_configs_info() + |
1 | job_paras_info = job_config_instance_list[0].get_job_configs_info() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
config_name + |
+Yes + |
+String + |
+Name of a training job parameter configuration + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
config_name + |
+String + |
+Name of a training job parameter configuration + |
+
config_desc + |
+String + |
+Description of a training job parameter configuration + |
+
worker_server_num + |
+Integer + |
+Number of workers in a training job + |
+
app_url + |
+String + |
+Code directory of a training job + |
+
boot_file_url + |
+String + |
+Boot file of a training job + |
+
model_id + |
+Long + |
+Model ID of a training job + |
+
parameter + |
+JSON Array + |
+Running parameters of a training job. It is a collection of label-value pairs. This parameter is a container environment variable when a job uses a custom image. + |
+
spec_id + |
+Long + |
+ID of the resource specifications selected for a training job + |
+
data_url + |
+String + |
+Dataset of a training job + |
+
dataset_id + |
+String + |
+Dataset ID of a training job + |
+
dataset_version_id + |
+String + |
+Dataset version ID of a training job + |
+
engine_type + |
+Short + |
+Engine type of a training job + |
+
engine_name + |
+String + |
+Name of the engine selected for a training job + |
+
engine_id + |
+Long + |
+ID of the engine selected for a training job + |
+
engine_version + |
+String + |
+Version of the engine selected for a training job + |
+
train_url + |
+String + |
+OBS URL of the output file of a training job. By default, this parameter is left blank. Example value: /usr/train/ + |
+
log_url + |
+String + |
+OBS URL of the logs of a training job. By default, this parameter is left blank. Example value: /usr/train/ + |
+
user_image_url + |
+String + |
+SWR URL of the custom image used by a training job + |
+
user_command + |
+String + |
+Boot command used to start the container of the custom image of a training job + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + framework_type='PyTorch', # AI engine name + framework_version='PyTorch-1.0.0-python3.6', # AI engine version + code_dir='/bucket/src/', # Training script directory + boot_file='/bucket/src/pytorch_sentiment.py', # Training boot script directory + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.gpu.p100', # Training environment flavor + train_instance_count=1) # Number of training nodes +update_info = estimator.update_job_configs(config_name='my_job_config', inputs='/bucket/dataset/', config_desc='update') + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator( + modelarts_session=session, + framework_type='PyTorch', # AI engine name + framework_version='PyTorch-1.0.0-python3.6', # AI engine version + code_dir='/bucket/src/', # Training script directory + boot_file='/bucket/src/pytorch_sentiment.py', # Training boot script directory + log_url='/bucket/log/', # Training log directory + hyperparameters=[ + {"label":"classes", + "value": "10"}, + {"label":"lr", + "value": "0.001"} + ], + output_path='/bucket/output/', # Training output directory + train_instance_type='modelarts.vm.gpu.p100', # Training environment flavor + train_instance_count=1) # Number of training nodes +update_info = estimator.update_job_configs(config_name='my_job_config', dataset_id='4AZNvFkN7KYr5EdhFkH', dataset_version_id='UOF9BIeSGArwVt0oI6T', config_desc='update') + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
train_instance_count + |
+Yes + |
+Long + |
+Number of workers in a training job + |
+
code_dir + |
+No + |
+String + |
+Code directory of a training job, for example, /bucket/src/. Leave this parameter blank when model_name is set. + |
+
boot_file + |
+No + |
+String + |
+Boot file of a training job, which needs to be stored in the code directory. For example, /bucket/src/boot.py. Leave this parameter blank when model_name is set. + |
+
model_name + |
+No + |
+Long + |
+Name of the built-in algorithm used by a training job. If you have configured model_name, you do not need to configure app_url, boot_file_url, framework_type, and framework_version. + |
+
output_path + |
+Yes + |
+String + |
+Output path of a training job + |
+
hyperparameters + |
+No + |
+JSON Array + |
+Running parameters of a training job. It is a collection of label-value pairs. This parameter is a container environment variable when a job uses a custom image. + |
+
log_url + |
+No + |
+String + |
+OBS URL of the logs of a training job. By default, this parameter is left blank. Example value: /usr/log/ + |
+
train_instance_type + |
+Yes + |
+Long + |
+Resource flavor selected for a training job. If you choose to train on the training platform, obtain the value by calling the API described in Querying the List of Resource Flavors. + |
+
framework_type + |
+No + |
+String + |
+Engine selected for a training job. Obtain the value by calling the API described in Querying the List of Engine Types. Leave this parameter blank when model_name is set. + |
+
framework_version + |
+No + |
+String + |
+Engine version selected for a training job. Obtain the value by calling the API described in Querying the List of Engine Types. Leave this parameter blank when model_name is set. + |
+
job_description + |
+No + |
+String + |
+Description of a training job + |
+
user_image_url + |
+No + |
+String + |
+SWR URL of the custom image used by a training job. Example value: 100.125.5.235:20202/jobmng/custom-cpu-base:1.0 + |
+
user_command + |
+No + |
+String + |
+Boot command used to start the container of the custom image of a training job. The format is bash /home/work/run_train.sh python /home/work/user-job-dir/app/train.py {python_file_parameter}. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
config_name + |
+Yes + |
+String + |
+Name of a training job parameter configuration. The value is a string of 1 to 20 characters consisting of only digits, letters, underscores (_), and hyphens (-). By default, if this parameter is left blank, the value is dynamically generated by date. + |
+
config_desc + |
+No + |
+String + |
+Description of a training job parameter configuration. The value is a string of 0 to 256 characters. By default, this parameter is left blank. + |
+
inputs + |
+No + |
+String + |
+OBS storage path of a training job + |
+
dataset_id + |
+No + |
+String + |
+Dataset ID of a training job. This parameter must be used together with dataset_version_id, but cannot be used together with inputs. + |
+
dataset_version_id + |
+No + |
+String + |
+Dataset version ID of a training job. This parameter must be used together with dataset_id, but cannot be used together with inputs. + |
+
data_source + |
+No + |
+JSON Array + |
+Dataset of a training job. This parameter cannot be used together with inputs, dataset_id, or dataset_version_id. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
dataset_id + |
+No + |
+String + |
+Dataset ID of a training job + |
+
dataset_version + |
+No + |
+String + |
+Dataset version ID of a training job + |
+
type + |
+Yes + |
+String + |
+Dataset type. The value can be obs or dataset. + |
+
data_url + |
+No + |
+String + |
+OBS bucket path. This parameter cannot be used together with dataset_id or dataset_version. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +estimator = Estimator(modelarts_session=session, config_name="my_job_config") +status = estimator.delete_job_configs() + |
1 | status = job_config_instance.delete_job_configs() + |
1 | status = job_config_instance_list[0].delete_job_configs() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
config_name + |
+Yes + |
+String + |
+Name of a training job parameter configuration + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import VisualizationJob +session = Session() +job = VisualizationJob(modelarts_session=session) +job_visualization_instance = job.create_visualization_job(train_url='/bucket/train/', job_name='visualization_job', job_desc='my visualization job') + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
job_name + |
+No + |
+String + |
+Name of a visualization job. The value is a string of 1 to 20 characters consisting of only digits, letters, underscores (_), and hyphens (-). + |
+
job_desc + |
+No + |
+String + |
+Description of a visualization job. The value is a string of 0 to 256 characters. By default, this parameter is left blank. + |
+
train_url + |
+Yes + |
+String + |
+OBS path to the visualization file. The visualization file is provided for the visualization job to read and display, and is usually located in the training output path. The visualization file is generated by the tf.summary or tensorboardx.SummaryWriter module in the training code, and the file name usually starts with events.out.tfevents. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
VisualizationJob + |
+Object + |
+Visualization job object. This object contains attributes such as visualization_id, create_time, job_name, and status, and operations on a visualization job, such as querying, modifying, stopping, restarting, or deleting the visualization job. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
create_time + |
+Long + |
+Time when a visualization job is created + |
+
job_name + |
+String + |
+Name of a visualization job + |
+
status + |
+Byte + |
+Status of a visualization job. For details about the job statuses, see Job Statuses. + |
+
job_id + |
+String + |
+ID of a visualization job + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.estimator import VisualizationJob +session = Session() +job_visualization_instance_list = VisualizationJob.get_visualization_job_object_list(modelarts_session=session, is_show=True, status=8, per_page=10, page=1, sort_by="create_time", order="asc", search_content="job") + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
status + |
+No + |
+String + |
+Status of a visualization job. For details about the job statuses, see Job Statuses. + |
+
per_page + |
+No + |
+Integer + |
+Number of jobs displayed on each page. The value range is [1, 100]. Default value: 10 + |
+
page + |
+No + |
+Integer + |
+Index of the page to be queried. Default value: 1 + |
+
sortBy/sort_by + |
+No + |
+String + |
+When AK/SK-based authentication is used, the parameter name is sortBy. When the username and password are used for authentication, the parameter name is sort_by. The parameter specifies the sorting mode of the query. The value can be job_name, job_desc, status, duration, create_time, or log_dir. Default value: job_name + |
+
order + |
+No + |
+String + |
+Sorting order. The options are as follows: +
|
+
search_content + |
+No + |
+String + |
+Search content, for example, a visualization job name. The value is a string of 0 to 100 characters. By default, this parameter is left blank. + |
+
is_show + |
+No + |
+Boolean + |
+Whether to print the visualization job list. Default value: True + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
VisualizationJob + |
+Object + |
+Visualization job object. This object contains attributes such as visualization_id, create_time, job_name, and status, and operations on a visualization job, such as querying, modifying, stopping, restarting, or deleting the visualization job. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
create_time + |
+Long + |
+Time when a visualization job is created + |
+
job_name + |
+String + |
+Name of a visualization job + |
+
status + |
+Byte + |
+Status of a visualization job. For details about the job statuses, see Job Statuses. + |
+
job_id + |
+String + |
+ID of a visualization job + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.estimator import VisualizationJob +session = Session() +job_list = VisualizationJob.get_visualization_job_list(modelarts_session=session, status=8, per_page=10, page=1, sort_by="create_time", order="asc", search_content="job") + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
status + |
+No + |
+String + |
+Status of a visualization job. For details about the job statuses, see Job Statuses. + |
+
per_page + |
+No + |
+Integer + |
+Number of jobs displayed on each page. The value range is [1, 100]. Default value: 10 + |
+
page + |
+No + |
+Integer + |
+Index of the page to be queried. Default value: 1 + |
+
sortBy/sort_by + |
+No + |
+String + |
+When AK/SK-based authentication is used, the parameter name is sortBy. When the username and password are used for authentication, the parameter name is sort_by. The parameter specifies the sorting mode of the query. The value can be job_name, job_desc, status, duration, create_time, or log_dir. Default value: job_name + |
+
order + |
+No + |
+String + |
+Sorting order. The options are as follows: +
|
+
search_content + |
+No + |
+String + |
+Search content, for example, a visualization job name. The value is a string of 0 to 100 characters. By default, this parameter is left blank. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
job_total_count + |
+Integer + |
+Total number of the queried visualization jobs + |
+
job_count_limit + |
+Integer + |
+Number of visualization jobs that can be created + |
+
jobs + |
+JSON Array + |
+Visualization job attributes. For details, see Table 3. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
job_id + |
+Integer + |
+ID of a visualization job + |
+
job_name + |
+String + |
+Name of a visualization job + |
+
status + |
+Integer + |
+Status of a visualization job. For details about the job statuses, see Job Statuses. + |
+
create_time + |
+Long + |
+Time when a visualization job is created + |
+
duration + |
+Long + |
+Running duration of a visualization job, in milliseconds + |
+
job_desc + |
+String + |
+Description of a visualization job + |
+
service_url + |
+String + |
+Endpoint of a visualization job + |
+
train_url + |
+String + |
+Path to visualization job logs + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import VisualizationJob +session = Session() +job = VisualizationJob(modelarts_session=session, visualization_id='8992') +job_info = job.get_visualization_job_info() + |
1 | job_info = job_visualization_instance.get_visualization_job_info() + |
1 | job_info = job_visualization_instance_list[0].get_visualization_job_info() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
visualization_id + |
+Yes + |
+String + |
+ID of a visualization job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
job_name + |
+String + |
+Name of a visualization job + |
+
service_url + |
+String + |
+Endpoint of a visualization job + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
duration + |
+Long + |
+Running duration of a visualization job + |
+
create_time + |
+Long + |
+Time when a visualization job is created + |
+
train_url + |
+String + |
+OBS path to the visualization job output file + |
+
job_id + |
+Long + |
+ID of a visualization job + |
+
job_desc + |
+String + |
+Description of a visualization job + |
+
resource_id + |
+String + |
+Resource ID of a visualization job + |
+
status + |
+Integer + |
+Status of a visualization job. For details about the job statuses, see Job Statuses. + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import VisualizationJob +session = Session() +job = VisualizationJob(modelarts_session=session, visualization_id='8992') +job_description = job.update_visualization_job(job_desc='update visualization job') + |
1 | job_description = job_visualization_instance.update_visualization_job(job_desc='update visualization job') + |
1 | job_description = job_visualization_instance_list[0].update_visualization_job(job_desc='update visualization job') + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
visualization_id + |
+Yes + |
+String + |
+ID of a visualization job + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
job_desc + |
+Yes + |
+String + |
+Description of a visualization job. The value is a string of 0 to 256 characters. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import VisualizationJob +session = Session() +job = VisualizationJob(modelarts_session=session, visualization_id='8992') +status = job.stop_visualization_job() + |
1 | status = job_visualization_instance.stop_visualization_job() + |
1 | status = job_visualization_instance_list[0].stop_visualization_job() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
visualization_id + |
+Yes + |
+String + |
+ID of a visualization job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import VisualizationJob +session = Session() +job = VisualizationJob(modelarts_session=session, visualization_id='8992') +resp = job.restart_visualization_job() + |
1 | status = job_visualization_instance.restart_visualization_job() + |
1 | status = job_visualization_instance_list[0].restart_visualization_job() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
visualization_id + |
+Yes + |
+String + |
+ID of a visualization job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.estimator import VisualizationJob +session = Session() +job = VisualizationJob(modelarts_session=session, visualization_id='8992') +status = job.delete_visualization_job() + |
1 | status = job_visualization_instance.delete_visualization_job() + |
1 | status = job_visualization_instance_list[0].delete_visualization_job() + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
visualization_id + |
+Yes + |
+String + |
+ID of a visualization job + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +algo_info = Estimator.get_built_in_algorithms(modelarts_session=session) + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_code + |
+String + |
+Error code when the API fails to be called. For details, see . +This parameter is not included when the API call succeeds. + |
+
model_total_count + |
+Integer + |
+Number of models + |
+
models + |
+JSON Array + |
+Parameter list of a model + |
+
is_success + |
+Boolean + |
+Whether the API call succeeds + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
model_id + |
+Integer + |
+Model ID + |
+
model_name + |
+String + |
+Model name + |
+
model_usage + |
+Integer + |
+Model usage. The options are as follows: +
|
+
model_precision + |
+String + |
+Model precision + |
+
model_size + |
+Long + |
+Model size, in bytes + |
+
model_train_dataset + |
+String + |
+Model training dataset + |
+
model_dataset_format + |
+String + |
+Dataset format required by a model + |
+
model_description_url + |
+String + |
+URL of the model description + |
+
parameter + |
+JSON Array + |
+Running parameters of a model. It is a collection of label-value pairs. This parameter is a container environment variable when a job uses a custom image. For details, see the sample request. + |
+
create_time + |
+Long + |
+Time when a model is created + |
+
engine_id + |
+Long + |
+Engine ID of a model + |
+
engine_name + |
+String + |
+Engine name of a model + |
+
engine_version + |
+String + |
+Engine version of a model + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +algo_info = Estimator.get_train_instance_types(modelarts_session=session) + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
Type + |
+Description + |
+
---|---|
List + |
+List of resource flavor attributes + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.estimator import Estimator +session = Session() +engine_list = Estimator.get_framework_list(modelarts_session=session) + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
modelarts_session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
Type + |
+Description + |
+
---|---|
List + |
+List of engine flavor attributes. For details, see Table 3. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
framework_type + |
+String + |
+Engine type + |
+
framework_version + |
+String + |
+Engine version + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
The model import function covers the following aspects:
+In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Model +from modelarts.config.model_config import ServiceConfig,Params,Dependencies,Packages +session = Session() + |
1 | model_instance = Model(session, model_id="input your model id") + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 | model_instance = Model( + session, + model_name="input model name", # Model name + model_version="1.0.0", # Model version + source_location=model_location, # OBS path to a model file, for example, obs://your_obs_bucket/mode_file_path + model_type="MXNet", # Model type + model_algorithm="image_classification", # Model algorithm + execution_code="OBS_PATH", + input_params=input_params, # For details, see the input_params format description. + output_params=output_params, # For details, see the output_params format description. + dependencies=dependencies, # For details, see the dependencies format description. + apis=apis) + |
The SDK provides the definition of input_params and output_params parameter groups. The types of input_params and output_params are list, and those of the tuple objects in the list are Params.
+The following uses input_params as an example:
+1 +2 +3 +4 +5 +6 +7 +8 +9 | input_params = [] # The type of input_params is list. Multiple objects of the Params type can be stored. +input_params1 = Params( + url='url', # URL + param_name='param_name', # Parameter name + param_type='param_type', # Parameter type + min='min', + max='max', + param_desc='param_desc') +input_params.append(input_params1) + |
The SDK provides the definition of the dependencies parameter group. The type of dependencies is list, and those of the tuple objects in the list are Dependencies.
+The code is as follows:
+1 +2 +3 +4 +5 | dependencies = [] +dependency1 = Dependencies( + installer="pip", # Installation mode. pip is supported. + packages=packages) # Collection of dependency packages. For details about the definition format, see the definition of packages. +dependencies.append(dependency1) + |
The SDK provides the definition of the packages parameter group. The type of packages is list, and those of the tuple objects in the list are Packages.
+The code is as follows:
+1 +2 +3 +4 +5 +6 | packages = [] +package1 = Packages( + package_name="package_name", # Package name + package_version="version", # Package version + restraint="restraint") +packages.append(package1) + |
The following is an example of creating a dependencies parameter group:
+dependencies = [] +packages = [{ + "package_name": "numpy", + "package_version": "1.15.0", + "restraint": "EXACT"}, + { + "package_name": "h5py", + "package_version": "2.8.0", + "restraint": "EXACT"} + ] +dependency = Dependencies(installer="pip", packages=packages) +dependencies.append(dependency)+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
model_id + |
+Yes + |
+String + |
+Model ID + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
model_name + |
+No + |
+String + |
+Name of a model, which contains 1 to 64 characters that consist of only letters, digits, underscores (_), and hyphens (-). It must start with a letter. If this parameter is not specified, the system automatically generates a model name. + |
+
model_version + |
+Yes + |
+String + |
+Model version in the format of Digit.Digit.Digit. The value range of the digits is [0, 99]. The version number cannot start with 0, for example, 01.01.01. + |
+
publish + |
+No + |
+Bool + |
+Whether to publish a model. The options are as follows: +
|
+
source_location_type + |
+No + |
+String + |
+Model location type. The options are as follows: +
|
+
source_location + |
+Yes + |
+String + |
+Path (parent directory) of the model file +
|
+
environment + |
+No + |
+Environment instance + |
+Environment required for normal model running, such as the Python or TensorFlow version + |
+
source_job_id + |
+No + |
+String + |
+ID of the source training job. If the model is generated from a training job, specify this parameter for source tracing. If the model is imported from a third-party meta model, leave this parameter blank. By default, this parameter is left blank. + |
+
source_job_version + |
+No + |
+String + |
+Version of the source training job. If the model is generated from a training job, specify this parameter for source tracing. If the model is imported from a third-party meta model, leave this parameter blank. By default, this parameter is left blank. + |
+
source_type + |
+No + |
+String + |
+Model source type. Currently, the value can only be auto, which indicates an ExeML model (model download is not allowed). If the model is deployed by a training job, leave this parameter blank. By default, this parameter is left blank. + |
+
model_type + |
+Yes + |
+String + |
+Model type. The value can be TensorFlow, MXNet, Spark_MLlib, Scikit_Learn, XGBoost, MindSpore, Image, or PyTorch. + |
+
model_algorithm + |
+No + |
+String + |
+Model algorithm. If the algorithm has been configured in the model configuration file, this parameter can be left blank. For example, predict_analysis, object_detection, or image_classification. + |
+
description + |
+No + |
+String + |
+Model description, which contains a maximum of 100 characters and cannot contain the following special characters: !<>=&'" + |
+
execution_code + |
+No + |
+String + |
+OBS path to the execution script. The inference script must be stored in the model directory in the path where the model is located. For details, see the source_location parameter. The script name is fixed to customize_service.py. + |
+
input_params + |
+No + |
+params array + |
+List of input parameters for model inference. By default, this parameter is left blank. If the apis information has been configured in the model configuration file, you do not need to set this parameter. The backend automatically reads the input parameters from the apis field in the configuration file. + |
+
output_params + |
+No + |
+params array + |
+List of output parameters for model inference. By default, this parameter is left blank. If the apis information has been configured in the model configuration file, you do not need to set this parameter. The backend automatically reads the output parameters from the apis field in the configuration file. + |
+
dependencies + |
+No + |
+dependency array + |
+Dependency package required for running the code and model. By default, this parameter is left blank. If the dependencies information has been configured in the model configuration file, you do not need to set this parameter. The backend automatically reads the dependencies to be installed from the dependencies field in the configuration file. + |
+
apis + |
+No + |
+String + |
+List of inference APIs provided by a model. By default, this parameter is left blank. If the apis information has been configured in the model configuration file, you do not need to set this parameter. The backend automatically reads the configured inference API information from the apis field in the configuration file. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
url + |
+Yes + |
+String + |
+Request path of a model inference API + |
+
param_name + |
+Yes + |
+String + |
+Parameter name, which contains a maximum of 64 characters + |
+
param_type + |
+Yes + |
+String + |
+Basic parameter types of JSON schema, including string, object, array, boolean, number, and integer + |
+
min + |
+No + |
+Double + |
+This parameter is optional when param_type is set to int or float. By default, this parameter is left blank. + |
+
max + |
+No + |
+Double + |
+This parameter is optional when param_type is set to int or float. By default, this parameter is left blank. + |
+
param_desc + |
+No + |
+String + |
+Parameter description, which contains a maximum of 100 characters. By default, this parameter is left blank. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
installer + |
+Yes + |
+String + |
+Installation mode. Only pip is supported. + |
+
packages + |
+Yes + |
+package array + |
+Collection of dependency packages + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
package_name + |
+Yes + |
+String + |
+Name of a dependency package + |
+
package_version + |
+No + |
+String + |
+Version of a dependency package + |
+
restraint + |
+No + |
+String + |
+Version filtering condition. This parameter is mandatory only when package_version exists. Possible values are as follows: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
model_instance + |
+Yes + |
+Model object + |
+Model object, which can be any of the APIs described in this chapter + |
+
1 +2 +3 +4 +5 +6 +7 +8 +9 | from modelarts.session import Session +from modelarts.model import Model +session = Session() +model_instance = Model(session, + model_name = "digit recognition", + model_version = "1.0.0", + source_location = model_location, + model_type = "MXNet", + model_algorithm = "image_classification") + |
In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Model +session = Session() +model_list = Model.get_model_list(session) + |
1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Model +session = Session() +model_list = Model.get_model_list(session, model_status="published", model_name="digit", order="desc") + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
model_name + |
+No + |
+String + |
+Model name. Fuzzy match is supported. + |
+
model_version + |
+No + |
+String + |
+Model version + |
+
model_status + |
+No + |
+String + |
+Model status. The value can be publishing, published, or failed. You can query jobs based on their statuses. + |
+
description + |
+No + |
+String + |
+Description. Fuzzy match is supported. + |
+
offset + |
+No + |
+Integer + |
+Index of the page to be queried. Default value: 0 + |
+
limit + |
+No + |
+Integer + |
+Maximum number of records returned on each page. Default value: 280 + |
+
sort_by + |
+No + |
+String + |
+Sorting mode. The value can be create_at, model_version, or model_size. Default value: create_at + |
+
order + |
+No + |
+String + |
+Sorting order. The value can be asc or desc, indicating the ascending or descending order. Default value: desc + |
+
workspace_id + |
+No + |
+String + |
+Workspace ID. Default value: 0 + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
total_count + |
+Integer + |
+Total number of models that meet the search criteria when no paging is implemented + |
+
count + |
+Integer + |
+Number of models + |
+
models + |
+model array + |
+Model metadata + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
model_id + |
+String + |
+Model ID + |
+
model_name + |
+String + |
+Model name + |
+
model_version + |
+String + |
+Model version + |
+
model_type + |
+String + |
+Model type. The value can be TensorFlow, MXNet, Spark_MLlib, Scikit_Learn, XGBoost, MindSpore, Image, or PyTorch. + |
+
model_size + |
+Long + |
+Model size, in bytes + |
+
tenant + |
+String + |
+Tenant to whom a model belongs + |
+
project + |
+String + |
+Project to which a model belongs + |
+
owner + |
+String + |
+User to whom a model belongs + |
+
create_at + |
+Long + |
+Time when a model is created, in milliseconds calculated from 1970.1.1 0:0:0 UTC + |
+
description + |
+String + |
+Model description + |
+
source_type + |
+String + |
+Model source type. This parameter is valid only when the model is deployed by an ExeML project. The value is auto. + |
+
In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Model +session = Session() +model_object_list = Model.get_model_object_list(session) + |
1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Model +session = Session() +model_object_list = Model.get_model_object_list(session, model_status="published", model_name="digit", order="desc") + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
model_name + |
+No + |
+String + |
+Model name. Fuzzy match is supported. + |
+
model_version + |
+No + |
+String + |
+Model version + |
+
model_status + |
+No + |
+String + |
+Model status. The value can be publishing, published, or failed. You can obtain models based on their statuses. + |
+
description + |
+No + |
+String + |
+Description. Fuzzy match is supported. + |
+
offset + |
+No + |
+Integer + |
+Index of the page to be obtained. Default value: 0 + |
+
limit + |
+No + |
+Integer + |
+Maximum number of records returned on each page. Default value: 280 + |
+
sort_by + |
+No + |
+String + |
+Sorting mode. The value can be create_at, model_version, or model_size. Default value: create_at + |
+
order + |
+No + |
+String + |
+Sorting order. The value can be asc or desc, indicating the ascending or descending order. Default value: desc + |
+
workspace_id + |
+No + |
+String + |
+Workspace ID. Default value: 0 + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
model_id + |
+String + |
+Model ID + |
+
model_name + |
+String + |
+Model name + |
+
model_version + |
+String + |
+Model version + |
+
model_type + |
+String + |
+Model type. The value can be TensorFlow, MXNet, Spark_MLlib, Scikit_Learn, XGBoost, MindSpore, Image, or PyTorch. + |
+
model_size + |
+Long + |
+Model size, in bytes + |
+
tenant + |
+String + |
+Tenant to whom a model belongs + |
+
project + |
+String + |
+Project to which a model belongs + |
+
owner + |
+String + |
+User to which a model belongs + |
+
create_at + |
+Long + |
+Time when a model is created, in milliseconds calculated from 1970.1.1 0:0:0 UTC + |
+
description + |
+String + |
+Model description + |
+
source_type + |
+String + |
+Model source type. This parameter is valid only when the model is deployed by an ExeML project. The value is auto. + |
+
You can use the API to query the information about a model object.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.model import Model +session = Session() +model_instance = Model(session, model_id="input your model_id") +model_info = model_instance.get_model_info() + |
1 +2 +3 +4 +5 +6 | from modelarts.session import Session +from modelarts.model import Model +session = Session() +model_object_list = Model.get_model_object_list(session) +model_instance = model_object_list[0] +model_info = model_instance.get_model_info() + |
Parameter + |
+Type + |
+Description + |
+
---|---|---|
model_id + |
+String + |
+Model ID + |
+
model_name + |
+String + |
+Model name + |
+
model_version + |
+String + |
+Model version + |
+
tenant + |
+String + |
+Tenant + |
+
project + |
+String + |
+Project + |
+
owner + |
+String + |
+User + |
+
create_at + |
+Long + |
+Time when a model is created, in milliseconds calculated from 1970.1.1 0:0:0 UTC + |
+
source_location + |
+String + |
+OBS path where a model resides + |
+
source_job_id + |
+String + |
+ID of the source training job + |
+
source_job_version + |
+String + |
+Version of the source training job + |
+
source_type + |
+String + |
+Type of a model source +
|
+
model_type + |
+String + |
+Model type. The value can be TensorFlow, MXNet, Spark_MLlib, Scikit_Learn, XGBoost, MindSpore, Image, or PyTorch. + |
+
model_size + |
+Long + |
+Model size, in bytes + |
+
model_status + |
+String + |
+Model status. The value can be publishing, published, or failed. + |
+
description + |
+String + |
+Model description + |
+
execution_code + |
+String + |
+OBS path for storing the execution code. The name of the execution code file is fixed to customize_service.py. + |
+
schema_doc + |
+String + |
+Download address of the model schema file + |
+
image_address + |
+String + |
+Execution image path of a model. Before the image is built, that is, before a model has been published as a service, this parameter is left blank. + |
+
input_params + |
+params array + |
+Collection of input parameters of a model. By default, this parameter is left blank. + |
+
output_params + |
+params array + |
+Collection of output parameters of a model. By default, this parameter is left blank. + |
+
dependencies + |
+dependency array + |
+Package required for running the code and model + |
+
model_metrics + |
+String + |
+Model evaluation parameter. This parameter is returned only when source_job_id and source_job_version are assigned values and the corresponding training job has evaluation results. + |
+
apis + |
+String + |
+All apis input and output parameters of the model + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
url + |
+String + |
+API URL + |
+
param_name + |
+String + |
+Parameter name, which contains a maximum of 64 characters + |
+
param_type + |
+String + |
+Parameter type. The value can be int, string, float, timestamp, date, or file. + |
+
min + |
+Number + |
+When param_type is set to int or float and min is set during model creation, the value will be returned. By default, this parameter is left blank. + |
+
max + |
+Number + |
+When param_type is set to int or float and max is set during model creation, the value will be returned. By default, this parameter is left blank. + |
+
param_desc + |
+String + |
+Parameter description, which contains a maximum of 100 characters. By default, this parameter is left blank. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
installer + |
+String + |
+Installer + |
+
packages + |
+package array + |
+Collection of dependency packages + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
package_name + |
+String + |
+Name of a dependency package + |
+
package_version + |
+String + |
+Version of a dependency package + |
+
restraint + |
+String + |
+Version filtering criterion. The options are as follows: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
f1 + |
+Yes + |
+Double + |
+Mean + |
+
recall + |
+Yes + |
+Double + |
+Recall + |
+
precision + |
+Yes + |
+Double + |
+Precision + |
+
accuracy + |
+Yes + |
+Double + |
+Accuracy + |
+
You can use the API to delete a model object.
+In a ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.model import Model +session = Session() +model_instance = Model(session, model_id="input your model_id") +model_instance.delete_model() + |
1 +2 +3 +4 +5 +6 | from modelarts.session import Session +from modelarts.model import Model +session = Session() +model_object_list = Model.get_model_object_list(session) +model_instance = model_object_list[0] +model_instance.delete_model() + |
Service management indicates deploying a model that has been successfully created as a real-time. This feature provides functions such as real-time prediction, service details query, and service log query.
+The real-time services include predictor and transformer, both of which provide the functions described in the following sections. This chapter uses predictor as an example.
+The sample code in this chapter is implemented in ModelArts notebook instances. If the code is used in other development environments, the session needs to be authenticated. For details about session authentication, see Session Authentication.
+Real-time service deployment covers the following aspects:
+The service object predictor is returned after deployment. The attributes of the service object include all functions described in this chapter.
+In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_instance = Predictor(session, service_id="input your service_id") + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 | from modelarts.session import Session +from modelarts.model import Model +from modelarts.config.model_config import ServiceConfig,TransformerConfig +session = Session() +model_instance = Model(session, model_id="input your model_id") +predictor_instance = model_instance.deploy_predictor( + service_name="input service predictor name", + infer_type="real-time", + vpc_id="vpc_id", + subnet_network_id="subnet_network_id ", + security_group_id="security_group_id", + configs=configs) # predictor configuration parameters. For details, see the format description of the configs parameter. + |
The model_id parameter specifies the model to be deployed as a real-time service. You can obtain the value by calling the API described in Obtaining the Model List or from the ModelArts management console.
+1 +2 +3 +4 +5 +6 +7 | transformer = model_instance.deploy_transformer( + service_name="input service transformer name", + infer_type="batch", + vpc_id="vpc_id", + subnet_network_id="subnet_network_id ", + security_group_id="security_group_id", + configs=configs) # transformer configuration parameter. For details, see the format description of the configs parameter. + |
The SDK provides the definition of the configs parameter. The type of configs is list, and those of the tuple objects in the list are ServiceConfig. The code is as follows:
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 | configs = [] +service_config1 = ServiceConfig( + model_id="model_id1", + weight="70", + specification="specification", + instance_count=2, + envs=envs) # Environment variable value, for example, envs = {"model_name":"mxnet-model-1", "load_epoch":"0"} +service_config2 = ServiceConfig( + model_id="model_id2", + weight="30", + specification="specification", + instance_count=2, + envs=envs) # Environment variable value, for example, envs = {"model_name":"mxnet-model-1", "load_epoch":"0"} +configs.append(service_config1, service_config2) + |
The SDK provides the definition of the configs parameter. The type of configs is list, and those of the tuple objects in the list are TransformerConfig. The code is as follows:
+1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 | configs = [] +transformer_config1 = TransformerConfig( + model_id="model_id", + specification="specification", + instance_count=2, + src_path="src_path", + dest_path="dest_path", + req_uri="req_uri", + mapping_type="mapping_type", + mapping_rule="mapping_rule", + envs=envs) # Environment variable value, for example, envs = {"model_name":"mxnet-model-1", "load_epoch":"0"} +configs.append(transformer_config1) + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
service_id + |
+Yes + |
+String + |
+Service ID, which can be obtained from the real-time service on the ModelArts management console + |
+
session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
service_name + |
+No + |
+String + |
+Service name, which consists of 1 to 64 characters. It must start with a letter. Only letters, digits, hyphens (-), and underscores (_) are allowed. + |
+
description + |
+No + |
+String + |
+Service description, which contains a maximum of 100 characters. By default, this parameter is left blank. + |
+
infer_type + |
+No + |
+String + |
+Inference mode. The value can be real-time or batch. The default value is real-time. +
|
+
vpc_id + |
+No + |
+String + |
+ID of the VPC to which a real-time service instance is deployed. By default, this parameter is left blank. In this case, ModelArts allocates a dedicated VPC to each user, and users are isolated from each other. If you need to access other service components in the VPC of the service instance, set this parameter to the ID of the corresponding VPC. +Once a VPC is configured, it cannot be modified. When vpc_id and cluster_id are configured, only the dedicated cluster parameter takes effect. + |
+
subnet_network_id + |
+No + |
+String + |
+ID of a subnet. By default, this parameter is left blank. This parameter is mandatory when vpc_id is configured. Enter the network ID displayed in the subnet details on the VPC management console. A subnet provides dedicated network resources that are isolated from other networks. + |
+
security_group_id + |
+No + |
+String + |
+Security group. By default, this parameter is left blank. This parameter is mandatory when vpc_id is configured. A security group is a virtual firewall that provides secure network access control policies for service instances. A security group must contain at least one inbound rule to permit the requests whose protocol is TCP, source address is 0.0.0.0/0, and port number is 8080. + |
+
configs + |
+Yes + |
+configs parameters of predictor and transformer + |
+Model running configurations +
|
+
schedule + |
+No + |
+schedule array + |
+Service scheduling configuration, which can be configured only for real-time services. By default, this parameter is not used. Services run for a long time. For details, see Table 6. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
model_id + |
+Yes + |
+String + |
+Model ID. You can obtain the value by calling the API described in Obtaining the Model List or from the ModelArts management console. + |
+
weight + |
+Yes + |
+Integer + |
+Weight of traffic allocated to a model. This parameter is mandatory only when infer_type is set to real-time. The sum of multiple weights must be equal to 100. If multiple model versions are configured in a real-time service and different traffic weights are set, ModelArts continuously accesses the prediction API of the service and forwards prediction requests to the model instances of the corresponding versions based on the weights. +{ +"service_name": "mnist", +"description": "mnist service", +"infer_type": "real-time", +"config": [ +{ +"model_id": "xxxmodel-idxxx", +"weight": "70", +"specification": "modelarts.vm.cpu.2u", +"instance_count": 1, +"envs": +{ +"model_name": "mxnet-model-1", +"load_epoch": "0" +} +}, +{ +"model_id": "xxxxxx", +"weight": "30", +"specification": "modelarts.vm.cpu.2u", +"instance_count": 1 +} +] +}+ |
+
specification + |
+Yes + |
+String + |
+Resource specifications. + |
+
instance_count + |
+Yes + |
+Integer + |
+Number of instances deployed in a model. The maximum number of instances is 5. To use more instances, submit a service ticket. + |
+
envs + |
+No + |
+Map<String, String> + |
+(Optional) Environment variable key-value pair required for running a model. By default, this parameter is left blank. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
model_id + |
+Yes + |
+String + |
+Model ID + |
+
specification + |
+Yes + |
+String + |
+Resource flavor. Currently, modelarts.vm.cpu.2u and modelarts.vm.gpu.p4 are available. + |
+
instance_count + |
+Yes + |
+Integer + |
+Number of instances deployed in a model. The value range during the closed beta test is [1, 2]. + |
+
envs + |
+No + |
+Map<String, String> + |
+(Optional) Environment variable key-value pair required for running a model. By default, this parameter is left blank. + |
+
src_path + |
+Yes + |
+String + |
+OBS path of the input data of a batch job + |
+
dest_path + |
+Yes + |
+String + |
+OBS path of the output data of a batch job + |
+
req_uri + |
+Yes + |
+String + |
+Inference API called in a batch task, that is, the RESTful API exposed in the model image. You must select an API URL from the config.json file of the model for inference. If a built-in inference image of ModelArts is used, the API is displayed as /. + |
+
mapping_type + |
+Yes + |
+String + |
+Mapping type of the input data. The value can be file or csv. +
The following shows how to create a batch service whose mapping_type is set to file: +{ +"service_name": "batchservicetest", +"description": "", +"infer_type": "batch", +"config": [{ +"model_id": "598b913a-af3e-41ba-a1b5-bf065320f1e2", +"specification": "modelarts.vm.cpu.2u", +"instance_count": 1, +"src_path": "https://infers-data.obs.xxx.com/xgboosterdata/", +"dest_path": "https://infers-data.obs.xxx.com/output/", +"req_uri": "/", +"mapping_type": "file" +}] +}+ The following shows how to create a batch service whose mapping_type is set to csv: +{ +"service_name": "batchservicetest", +"description": "", +"infer_type": "batch", +"config": [{ +"model_id": "598b913a-af3e-41ba-a1b5-bf065320f1e2", +"specification": "modelarts.vm.cpu.2u", +"instance_count": 1, +"src_path": "https://infers-data.obs.xxx.com/xgboosterdata/", +"dest_path": "https://infers-data.obs.xxx.com/output/", +"req_uri": "/", +"mapping_type": "csv", +"mapping_rule": { +"type": "object", +"properties": { +"data": { +"type": "object", +"properties": { +"req_data": { +"type": "array", +"items": [{ +"type": "object", +"properties": { +"input5": { +"type": "number", +"index": 0 +}, +"input4": { +"type": "number", +"index": 1 +}, +"input3": { +"type": "number", +"index": 2 +}, +"input2": { +"type": "number", +"index": 3 +}, +"input1": { +"type": "number", +"index": 4 +} +} +}] +} +} +} +} +} +}] +}+ |
+
mapping_rule + |
+No + |
+Map + |
+Mapping between input parameters and CSV data. This parameter is mandatory only when mapping_type is set to csv. The mapping rule is similar to the input parameter definition in the config.json model configuration file. You only need to configure the index parameters under each parameter of the string, number, integer, or boolean type, and the value of this parameter to the values of the index parameters in the CSV file to send an inference request. Use commas (,) to separate multiple pieces of CSV data. The values of the index parameters start from 0. If the value of the index parameter is -1, ignore this parameter. For details, see the sample code of deploying transformer. +The format of the inference request body described in mapping_rule is as follows: +{ +"data": { +"req_data": [{ +"input1": 1, +"input2": 2, +"input3": 3, +"input4": 4, +"input5": 5 +}] +} +}+ |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
predictor + |
+Yes + |
+Predictor object + |
+Predictor object. Its attributes include all functions described in this chapter. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
op_type + |
+Yes + |
+String + |
+Scheduling type. Currently, only the value stop is supported. + |
+
time_unit + |
+Yes + |
+String + |
+Scheduling time unit. The options are as follows: +
|
+
duration + |
+Yes + |
+Integer + |
+Value that maps to the time unit. For example, if the task stops after two hours, set time_unit to HOURS and duration to 2. + |
+
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 | from modelarts.session import Session +from modelarts.model import Model +from modelarts.config.model_config import ServiceConfig,TransformerConfig +model_instance = Model(session, model_id = "input you model id") +configs = [] +config1 = ServiceConfig(model_id="input you model id", + weight="100", + instance_count=1, + specification="modelarts.vm.cpu.2u", + envs={"input_data_name":"images", + "input_data_shape":"0,1,28,28", + "output_data_shape":"0,10"}) +configs.append(config1) +predictor = model_instance.deploy_predictor(service_name="DigitRecognition", configs=configs) + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 | from modelarts.session import Session +from modelarts.model import Model +from modelarts.config.model_config import ServiceConfig,TransformerConfig +model_instance = Model(session, model_id = "input your model id") +configs = [] +config1 = TransformerConfig(model_id="input your model id", + specification="modelarts.vm.cpu.2u", + instance_count=1, + envs={"input_data_name":"images","input_data_shape":"0,1,28,28","output_data_shape":"0,10"}, + src_path="/w0403/testdigitrecognition/inferimages/", + dest_path="/w0403/testdigitrecognition/" , + req_uri = "/", + mapping_type = "file") +configs.append(config1) +predictor = model_instance.deploy_transformer(service_name="DigitRecognition", infer_type="batch", configs=configs) + |
You can use the API to query details about a service object.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_instance = Predictor(session, service_id="input your service_id") +predictor_info = predictor_instance.get_service_info() + |
1 +2 +3 +4 +5 +6 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_object_list = Predictor.get_service_object_list(session) +predictor_instance = predictor_object_list[0] +predictor_info = predictor_instance.get_service_info() + |
Parameter + |
+Type + |
+Description + |
+
---|---|---|
service_id + |
+String + |
+Service ID + |
+
service_name + |
+String + |
+Service name + |
+
description + |
+String + |
+Service description + |
+
tenant + |
+String + |
+Tenant to whom a service belongs + |
+
project + |
+String + |
+Project to which a service belongs + |
+
owner + |
+String + |
+User to whom a service belongs + |
+
publish_at + |
+Number + |
+Latest service publishing time, in milliseconds calculated from 1970.1.1 0:0:0 UTC + |
+
infer_type + |
+String + |
+Inference mode. The value can be real-time or batch. + |
+
vpc_id + |
+String + |
+ID of the VPC to which a service instance belongs. This parameter is returned when the network configuration is customized. + |
+
subnet_network_id + |
+String + |
+ID of the subnet where a service instance resides. This parameter is returned when the network configuration is customized. + |
+
security_group_id + |
+String + |
+Security group to which a service instance belongs. This parameter is returned when the network configuration is customized. + |
+
status + |
+String + |
+Service status. The value can be running, deploying, concerning, failed, stopped, or finished. + |
+
error_msg + |
+String + |
+Error message. When status is failed, the deployment failure cause is returned. + |
+
config + |
+config array corresponding to infer_type + |
+config array corresponding to infer_type +Service configurations (If a service is shared, only model_id, model_name, and model_version are returned.) + |
+
access_address + |
+String + |
+Access address of an inference request. This parameter is returned when infer_type is set to real-time. + |
+
invocation_times + |
+Number + |
+Total number of service calls + |
+
failed_times + |
+Number + |
+Number of failed service calls + |
+
is_shared + |
+Boolean + |
+Whether a service is subscribed + |
+
shared_count + |
+Number + |
+Number of subscriptions + |
+
progress + |
+Integer + |
+Deployment progress. This parameter is returned when status is deploying. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
model_id + |
+String + |
+Model ID. You can obtain the value by calling the API described in Obtaining the Model List or from the ModelArts management console. + |
+
model_name + |
+String + |
+Model name + |
+
model_version + |
+String + |
+Model version + |
+
source_type + |
+String + |
+Model source. This parameter is returned when a model is created by an ExeML project. The value is auto. + |
+
status + |
+String + |
+Running status of a model instance. Possible values are as follows: +
|
+
weight + |
+Integer + |
+Traffic weight allocated to a model + |
+
specification + |
+String + |
+Resource flavor. The value can be modelarts.vm.cpu.2u, modelarts.vm.gpu.p4, or modelarts.vm.ai1.a310. + |
+
envs + |
+Map<String, String> + |
+Environment variable key-value pair required for running a model + |
+
instance_count + |
+Integer + |
+Number of instances deployed in a model + |
+
scaling + |
+Boolean + |
+Whether auto scaling is enabled + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
model_id + |
+String + |
+Model ID. You can obtain the value by calling the API described in Obtaining the Model List or from the ModelArts management console. + |
+
model_name + |
+String + |
+Model name + |
+
model_version + |
+String + |
+Model version + |
+
specification + |
+String + |
+Resource flavor. The value can be modelarts.vm.cpu.2u or modelarts.vm.gpu.p4. + |
+
envs + |
+Map<String, String> + |
+Environment variable key-value pair required for running a model + |
+
instance_count + |
+Integer + |
+Number of instances deployed in a model + |
+
src_path + |
+String + |
+OBS path of the input data of a batch job + |
+
dest_path + |
+String + |
+OBS path of the output data of a batch job + |
+
req_uri + |
+String + |
+Inference path of a batch job + |
+
mapping_type + |
+String + |
+Mapping type of the input data. The value can be file or csv. + |
+
mapping_rule + |
+Map + |
+Mapping between input parameters and CSV data. This parameter is returned only when mapping_type is set to csv. + |
+
You can use the API to obtain the service list of a user.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_list = Predictor.get_service_list(session) + |
1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_list = Predictor.get_service_list(session, service_name="digit", order="asc", offset="0", infer_type="real-time") + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
service_id + |
+No + |
+String + |
+Service ID. By default, the service ID is not filtered. + |
+
service_name + |
+No + |
+String + |
+Service name. By default, the service name is not filtered. + |
+
infer_type + |
+No + |
+String + |
+Inference mode. The value can be real-time or batch. By default, this parameter is left blank. + |
+
offset + |
+No + |
+Integer + |
+Start page of the paging list. Default value: 0 + |
+
limit + |
+No + |
+Integer + |
+Maximum number of records returned on each page. Default value: 1000 + |
+
service_status + |
+No + |
+String + |
+Service status. By default, the service status is not filtered. The service list can be queried based on the service status. Possible values are as follows: +
|
+
sort_by + |
+No + |
+String + |
+Sorting mode. The value can be publish_at or service_name. Default value: publish_at + |
+
order + |
+No + |
+String + |
+Sorting order. The value can be asc or desc, indicating the ascending or descending order. Default value: desc + |
+
model_id + |
+No + |
+String + |
+Model ID. By default, the model ID is not filtered. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
total_count + |
+Integer + |
+Total number of services that meet the search criteria when no paging is implemented + |
+
count + |
+Integer + |
+Number of services in the query result. If offset and limit are not set, the values of count and total are the same. + |
+
services + |
+service array + |
+Collection of the queried services + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
service_id + |
+String + |
+Service ID + |
+
service_name + |
+String + |
+Service name + |
+
description + |
+String + |
+Service description + |
+
tenant + |
+String + |
+Tenant to whom a service belongs + |
+
project + |
+String + |
+Project to which a service belongs + |
+
owner + |
+String + |
+User to whom a service belongs + |
+
publish_at + |
+Number + |
+Latest service publishing time, in milliseconds calculated from 1970.1.1 0:0:0 UTC + |
+
infer_type + |
+String + |
+Inference mode. The value can be real-time or batch. + |
+
status + |
+String + |
+Service status. The value can be running, deploying, concerning, failed, stopped, or finished. + |
+
progress + |
+Integer + |
+Deployment progress. This parameter is returned when status is deploying. + |
+
invocation_times + |
+Number + |
+Total number of service calls + |
+
failed_times + |
+Number + |
+Number of failed service calls + |
+
is_shared + |
+Boolean + |
+Whether a service is subscribed + |
+
shared_count + |
+Number + |
+Number of subscriptions + |
+
You can use the API to obtain the service object list of a user.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_list_object_resp = Predictor.get_service_object_list(session) + |
1 +2 +3 +4 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_object_list = Predictor.get_service_object_list(session, service_name="digit", order="asc", offset="0", infer_type="real-time") + |
For example, in service_list_resp = [service_instance1, service_instance2, service_instance3 ...], each service_instance in the list is a service API that can be called in the service management section.
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
session + |
+Yes + |
+Object + |
+Session object. For details about the initialization method, see Session Authentication. + |
+
is_show + |
+No + |
+Boolean + |
+Whether to print service object information. Default value: True + |
+
service_id + |
+No + |
+String + |
+Service ID. By default, the service ID is not filtered. + |
+
service_name + |
+No + |
+String + |
+Service name. By default, the service name is not filtered. + |
+
infer_type + |
+No + |
+String + |
+Inference mode. The value can be real-time or batch. By default, this parameter is left blank. + |
+
offset + |
+No + |
+Integer + |
+Start page of the paging list. Default value: 0 + |
+
limit + |
+No + |
+Integer + |
+Maximum number of records returned on each page. Default value: 1000 + |
+
sort_by + |
+No + |
+String + |
+Sorting mode. The value can be publish_at or service_name. Default value: publish_at + |
+
order + |
+No + |
+String + |
+Sorting order. The value can be asc or desc, indicating the ascending or descending order. Default value: desc + |
+
model_id + |
+No + |
+String + |
+Model ID. By default, the model ID is not filtered. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
total_count + |
+Integer + |
+Total number of services that meet the search criteria when no paging is implemented + |
+
count + |
+Integer + |
+Number of services in the query result. If offset and limit are not set, the values of count and total are the same. + |
+
services + |
+service array + |
+Collection of the queried services + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
service_id + |
+String + |
+Service ID + |
+
service_name + |
+String + |
+Service name + |
+
description + |
+String + |
+Service description + |
+
tenant + |
+String + |
+Tenant to whom a service belongs + |
+
project + |
+String + |
+Project to which a service belongs + |
+
owner + |
+String + |
+User to whom a service belongs + |
+
publish_at + |
+Number + |
+Latest service publishing time, in milliseconds calculated from 1970.1.1 0:0:0 UTC + |
+
infer_type + |
+String + |
+Inference mode. The value can be real-time or batch. + |
+
status + |
+String + |
+Service status. The value can be running, deploying, concerning, failed, stopped, or finished. + |
+
progress + |
+Integer + |
+Deployment progress. This parameter is returned when status is deploying. + |
+
invocation_times + |
+Number + |
+Total number of service calls + |
+
failed_times + |
+Number + |
+Number of failed service calls + |
+
is_shared + |
+Boolean + |
+Whether a service is subscribed + |
+
shared_count + |
+Number + |
+Number of subscriptions + |
+
You can use the API to update the configurations of a service object.
+In ModelArts notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 +6 +7 +8 +9 | from modelarts.session import Session +from modelarts.model import Predictor +from modelarts.config.model_config import ServiceConfig +session = Session() +predictor_instance = Predictor(session, service_id="input your service_id") +configs = [ServiceConfig(weight="100", instance_count=1, specification="modelarts.vm.cpu.2u",model_id="input your model_id")] +service_config = predictor_instance.update_service_config(description="description", + status="running", + configs=configs) + |
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 | from modelarts.session import Session +from modelarts.model import Predictor +from modelarts.config.model_config import ServiceConfig +session = Session() +predictor_object_list = Predictor.get_service_object_list(session) +predictor_instance = predictor_object_list[0] +configs = [ServiceConfig(weight="100", instance_count=1, specification="modelarts.vm.cpu.2u",model_id="input your model_id")] +predictor_config = predictor_instance.update_service_config(description="description", + status="running", + configs=configs) + |
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
description + |
+No + |
+String + |
+Service description, which contains a maximum of 100 characters. If this parameter is not set, the service description is not updated. + |
+
status + |
+No + |
+String + |
+Service status. The value can be running or stopped. If this parameter is not set, the service status is not changed. status and configs cannot be modified at the same time. If both parameters exist, modify only the status parameter. + |
+
configs + |
+No + |
+predictor configs and transformer configs + |
+Service configurations. If this parameter is not set, the service is not updated. For details about how to generate configs, see Deploying a Real-Time Service. + |
+
The restrictions on updating service configurations are as follows:
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
model_id + |
+Yes + |
+String + |
+Model ID. You can obtain the value by calling the API described in Obtaining the Model List or from the ModelArts management console. + |
+
weight + |
+Yes + |
+Integer + |
+Weight of traffic allocated to a model. This parameter is mandatory only when infer_type is set to real-time. The sum of multiple weights must be equal to 100. If multiple model versions are configured in a real-time service and different traffic weights are set, ModelArts continuously accesses the prediction API of the service and forwards prediction requests to the model instances of the corresponding versions based on the weights. + |
+
specification + |
+Yes + |
+String + |
+Resource flavor. + |
+
instance_count + |
+Yes + |
+Integer + |
+Number of instances deployed in a model. The maximum number of instances is 5. To use more instances, submit a service ticket. + |
+
envs + |
+No + |
+Map<String, String> + |
+(Optional) Environment variable key-value pair required for running a model. By default, this parameter is left blank. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
model_id + |
+Yes + |
+String + |
+Model ID. You can obtain the value by calling the API described in Obtaining the Model List or from the ModelArts management console. + |
+
specification + |
+Yes + |
+String + |
+Resource flavor. Currently, modelarts.vm.cpu.2u and modelarts.vm.gpu.p4 are available. + |
+
instance_count + |
+Yes + |
+Integer + |
+Number of instances deployed in a model. The maximum number of instances is 5. To use more instances, submit a service ticket. + |
+
envs + |
+No + |
+Map<String, String> + |
+(Optional) Environment variable key-value pair required for running a model. By default, this parameter is left blank. + |
+
src_path + |
+Yes + |
+String + |
+OBS path of the input data of a batch job + |
+
dest_path + |
+Yes + |
+String + |
+OBS path of the output data of a batch job + |
+
req_uri + |
+Yes + |
+String + |
+Inference API called in batch tasks. You must select an API URL from the config.json file of the model for inference. + |
+
mapping_type + |
+Yes + |
+String + |
+Mapping type of the input data. The value can be file or csv. +
|
+
mapping_rule + |
+No + |
+Map + |
+Mapping between input parameters and CSV data. This parameter is mandatory only when mapping_type is set to csv. The mapping rule is similar to the definition of the input parameters in the config.json file. You only need to configure the index parameters under each parameter of the string, number, integer, or boolean type, and the value of this parameter to the values of the index parameters in the CSV file to send an inference request. Use commas (,) to separate multiple pieces of CSV data. The values of the index parameters start from 0. If the value of the index parameter is -1, ignore this parameter. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
error_code + |
+Yes + |
+String + |
+Error code when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+Yes + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
You can use the API to query the monitoring information about a service.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_instance = Predictor(session, service_id="input your service_id") +predictor_monitor = predictor_instance.get_service_monitor() + |
1 +2 +3 +4 +5 +6 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_object_list = Predictor.get_service_object_list(session) +predictor_instance = predictor_object_list[0] +predictor_monitor = predictor_instance.get_service_monitor() + |
Parameter + |
+Type + |
+Description + |
+
---|---|---|
service_id + |
+String + |
+Service ID + |
+
service_name + |
+String + |
+Service name + |
+
monitors + |
+monitor array corresponding to infer_type of a service + |
+Monitoring details + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
model_id + |
+String + |
+Model ID + |
+
model_name + |
+String + |
+Model name + |
+
model_version + |
+String + |
+Model version + |
+
invocation_times + |
+Number + |
+Total number of model instance calls + |
+
failed_times + |
+Number + |
+Number of failed model instance calls + |
+
cpu_core_usage + |
+Float + |
+Number of used CPUs + |
+
cpu_core_total + |
+Float + |
+Total number of CPUs + |
+
cpu_memory_usage + |
+Integer + |
+Used memory, in MBs + |
+
cpu_memory_total + |
+Integer + |
+Total memory, in MBs + |
+
gpu_usage + |
+Float + |
+Number of used GPUs + |
+
gpu_total + |
+Float + |
+Total number of GPUs + |
+
You can use the API to query the logs of a service object.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_instance = Predictor(session, service_id="input your service_id") +predictor_log = predictor_instance.get_service_logs() + |
1 +2 +3 +4 +5 +6 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_object_list = Predictor.get_service_object_list(session) +predictor_instance = predictor_object_list[0] +predictor_log = predictor_instance.get_service_logs() + |
Parameter + |
+Type + |
+Description + |
+
---|---|---|
service_id + |
+String + |
+Service ID + |
+
service_name + |
+String + |
+Service name + |
+
logs + |
+log array + |
+Service update logs + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
update_time + |
+Long + |
+Time when a service is updated, in milliseconds calculated from 1970.1.1 0:0:0 UTC + |
+
result + |
+String + |
+Update result. The value can be SUCCESS, FAIL, or RUNNING. + |
+
config + |
+config array + |
+Updated service configurations. This parameter is returned when infer_type is set to real-time. + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
model_id + |
+String + |
+Model ID + |
+
model_name + |
+String + |
+Model name + |
+
model_version + |
+String + |
+Model version + |
+
weight + |
+Integer + |
+Traffic weight allocated to a model + |
+
specification + |
+String + |
+Resource flavor + |
+
instance_count + |
+Integer + |
+Number of instances deployed in a model + |
+
envs + |
+Map<String, String> + |
+Environment variable key-value pair required for running a model + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
node_name + |
+String + |
+Name of an edge node + |
+
operation + |
+String + |
+Operation type. The value can be deploy or delete. + |
+
result + |
+Boolean + |
+Operation result. true indicates a successful operation, and false indicates a failed operation. + |
+
You can delete a service in either of the following ways:
+In a ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 +4 +5 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_instance = Predictor(session, service_id="input your service_id") +predictor_instance.delete_service() + |
1 +2 +3 +4 +5 +6 | from modelarts.session import Session +from modelarts.model import Predictor +session = Session() +predictor_object_list = Predictor.get_service_object_list(session) +predictor_instance = predictor_object_list[0] +predictor_instance.delete_service() + |
ModelArts SDK 1.1.3 supports OBS management, including uploading and downloading files and folders. The operations are as follows:
+ +In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 | from modelarts.session import Session +session = Session() +session.obs.upload_file(src_local_file='/home/ma-user/file1.txt', dst_obs_dir='obs://bucket-name/dir1/') + |
After the sample code is executed, the local source file file1.txt is uploaded to the dir1 folder in the bucket-name bucket. The path is obs://bucket-name/dir1/file1.txt. The bucket name and folder name are user-defined.
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
session + |
+Yes + |
+Object + |
+Session object + |
+
src_local_file + |
+Yes + |
+String + |
+Path to the local file to be uploaded + |
+
dst_obs_dir + |
+Yes + |
+String + |
+Path to the target OBS bucket. The path must start with obs:// and end with a slash (/). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 | from modelarts.session import Session +session = Session() +session.obs.upload_dir(src_local_dir='/home/ma-user/', dst_obs_dir='obs://bucket-name/dir1/') + |
After the sample code is executed, the local source folder /ma-user/ is uploaded to the dir1 folder in the bucket-name bucket. The path is obs://bucket-name/dir1/ma-user/. The bucket name and folder name are user-defined.
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
session + |
+Yes + |
+Object + |
+Session object + |
+
src_local_dir + |
+Yes + |
+String + |
+Path to the local folder to be uploaded. +If the folder to be uploaded is empty or contains multiple empty folders, no empty folders are created in the corresponding OBS path. + |
+
dst_obs_dir + |
+Yes + |
+String + |
+Path to the target OBS bucket. The path must start with obs:// and end with a slash (/). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
If the size of a file in a folder exceeds 5 GB, the file cannot be downloaded in this mode.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 | from modelarts.session import Session +session = Session() +session.obs.download_file(src_obs_file="obs://bucket-name/dir1/file1.txt", dst_local_dir="/home/ma-user/") + |
After the sample code is executed, source file file1.txt is downloaded from OBS to /home/ma-user/file1.txt.
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
session + |
+Yes + |
+Object + |
+Session object + |
+
src_obs_file + |
+Yes + |
+String + |
+Path to the source file to be downloaded from OBS. The path must start with obs://. + |
+
dst_local_dir + |
+Yes + |
+String + |
+Path to the target local folder. The path must end with a slash (/). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
If the size of a file in a folder exceeds 5 GB, the file cannot be downloaded in this mode. However, other files whose size is less than 5 GB in the folder can be downloaded.
+In the ModelArts notebook instance, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.
+1 +2 +3 | from modelarts.session import Session +session = Session() +session.obs.download_dir(src_obs_dir="obs://bucket-name/dir1/", dst_local_dir="/home/ma-user/work/") + |
After the sample code is executed, source folder dir1 is downloaded from OBS to /home/ma-user/work/dir1/.
+You must have the write permission on the local path.
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
---|---|---|---|
session + |
+Yes + |
+Object + |
+Session object + |
+
src_obs_dir + |
+Yes + |
+String + |
+Path to the source folder to be downloaded from OBS. The path must start with obs:// and end with a slash (/). If the downloaded folder contains empty folders, no empty folders are created in the corresponding local path. + |
+
dst_local_dir + |
+Yes + |
+String + |
+Path to the target local folder. The path must end with a slash (/). + |
+
Parameter + |
+Type + |
+Description + |
+
---|---|---|
error_code + |
+String + |
+Error code when the API call fails. +This parameter is not included when the API call succeeds. + |
+
error_msg + |
+String + |
+Error message when the API call fails. +This parameter is not included when the API call succeeds. + |
+
Using the SDK in non-notebook environments needs to call IAM, OBS, and ModelArts. Therefore, the endpoints of these services are required. Therefore, the endpoints of these services are required. To obtain the endpoints, configure as follows:
+from modelarts.session import Session +Session.set_endpoint(iam_endpoint="***", obs_endpoint="***", modelarts_endpoint="***", region_name="***")+ +
Parameter + |
+Description + |
+
---|---|
iam_endpoint + |
+IAM endpoint + |
+
obs_endpoint + |
+OBS endpoint + |
+
modelarts_endpoint + |
+ModelArts endpoint + |
+
region_name + |
+Region name + |
+