Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Modifying a Training Job Configuration

Updated on 2024-05-30 GMT+08:00

Function

This API is used to modify a training job configuration.

URI

PUT /v1/{project_id}/training-job-configs/{config_name}

Table 1 describes the required parameters.
Table 1 Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain a project ID, see Obtaining a Project ID and Name.

config_name

Yes

String

Name of a training job configuration

Request Body

Table 2 describes the request parameters.
Table 2 Parameters

Parameter

Mandatory

Type

Description

config_desc

No

String

Description of a training job configuration. The value must contain 0 to 256 characters. By default, this parameter is left blank.

worker_server_num

Yes

Integer

Number of workers in a training job. Obtain the maximum value from Querying Job Resource Specifications.

app_url

Yes

String

Code directory of a training job, for example, /usr/app/. This parameter must be used together with boot_file_url. After setting model_id, you do not need to set app_url or boot_file_url, and engine_id.

boot_file_url

Yes

String

Boot file of a training job, which needs to be stored in the code directory, for example, /usr/app/boot.py. This parameter must be used together with app_url. After setting model_id, you do not need to set app_url or boot_file_url, and engine_id.

model_id

Yes

Long

Model ID of a training job. Obtain model_id by calling the API described in Querying a Built-in Algorithm. After setting model_id, you do not need to set app_url or boot_file_url, and engine_id.

parameter

No

Array<Object>

Running parameters of a training job. It is a collection of label-value pairs. This parameter is a container environment variable when a training job uses a custom image. For details, see Table 4.

spec_id

Yes

Long

ID of the resource specifications selected for a training job. Obtain the ID by calling the API described in Querying Job Resource Specifications.

data_url

No

String

OBS URL of the dataset required by a training job, for example, /usr/data/.

This parameter cannot be used together with data_source or dataset_id and dataset_version_id. However, one of the parameters must exist.

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 data_url or data_source.

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 data_url or data_source.

data_source

No

JSON Array

Dataset of a training job. This parameter cannot be used together with data_url or dataset_id and dataset_version_id. For details, see Table 3.

engine_id

Yes

Long

ID of the engine selected for a training job. The default value is 1. Obtain the ID by calling the API described in Querying Job Engine Specifications.

train_url

No

String

OBS URL of the output file of a training job. By default, this parameter is left blank. Example value: /usr/train/

log_url

No

String

OBS URL of the logs of a training job. By default, this parameter is left blank. Example value: /usr/train/

user_image_url

No

String

SWR URL of a 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 a 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}.

Table 3 data_source parameters

Parameter

Mandatory

Type

Description

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 data_url.

dataset_version

No

String

Dataset version ID of a training job. This parameter must be used together with dataset_id, but cannot be used together with data_url.

type

No

String

Dataset type. The value can be obs or dataset. obs and dataset cannot be used at the same time.

data_url

No

String

OBS bucket path. This parameter cannot be used together with dataset_id or dataset_version.

Table 4 parameter parameters

Parameter

Mandatory

Type

Description

label

No

String

Parameter name.

value

No

String

Parameter value.

Response Body

Table 5 describes the response parameters.
Table 5 Parameters

Parameter

Type

Description

is_success

Boolean

Whether the request is successful

error_message

String

Error message of a failed API call.

This parameter is not included when the API call succeeds.

error_code

String

Error code of a failed API call. For details, see Error Codes. This parameter is not included when the API call succeeds.

Sample Request

The following shows how to modify the job parameter configuration named config.
PUT    https://endpoint/v1/{project_id}/training-job-configs/config

{
    "config_desc": "This is config",
    "worker_server_num": 1,
    "app_url": "/usr/app/",
    "boot_file_url": "/usr/app/boot.py",
    "parameter": [
        {
            "label": "learning_rate",
            "value": 0.01
        },
        {
            "label": "batch_size",
            "value": 32
        }
    ],
    "spec_id": 1,
    "dataset_id": "38277e62-9e59-48f4-8d89-c8cf41622c24",
    "dataset_version_id": "2ff0d6ba-c480-45ae-be41-09a8369bfc90",
    "engine_id": 1,
    "train_url": "/usr/train/",
    "log_url": "/usr/log/",
    "model_id": 1
}

Sample Response

  • Successful response
    {
        "is_success": true
    }
  • Failed response
    {
        "is_success": false,
        "error_message": "Error string",
        "error_code": "ModelArts.0105"
    }

Status Code

For details about the status code, see Table 1.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback