Obtaining the Metrics of a Fine-tuning Training Task
Function
This API is used to obtain the metric information about a fine-tuning training task, such as training loss.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.
URI
GET /v2/{project_id}/training-jobs/{training_job_id}/ft-metrics
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: The value can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed. Default Value: N/A |
| training_job_id | Yes | String | Definition: Training job ID. For details, see Obtaining Training Jobs. Constraints: N/A Range: N/A Default Value: N/A |
Request Parameters
None
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| loss | Object | Training loss information |
| eval_loss | Object | Evaluation loss information |
| training_info | Object | Estimated training duration |
| train_process | Double | Training progress information |
| data | FtMetricData object | Training metrics. |
| Parameter | Type | Description |
|---|---|---|
| format_version | String | Fixed value 1.0, indicating the data format version. |
| timestamp | String | File generation time in ISO 8601 format (e.g., 2026-07-18T10:30:00Z). |
| metrics | Array of FtMetric objects | Training metrics structure. |
| Parameter | Type | Description |
|---|---|---|
| name_cn | String | Metric Chinese name (e.g., Training Metrics, Accuracy), used on the frontend as legend or column names. |
| name_en | String | Metric English name (e.g., train_loss, val_accuracy), used on the frontend as legend or column names. |
| des_en | String | Metric Chinese description (e.g., training metrics), used on the frontend for metric description. |
| des_cn | String | Metric English description (e.g., train loss), used on the frontend for metric description. |
| type | String | Metric visualization type. Options include line (line chart), pie (pie chart), table (table), or scalar (single value); extensible to image, etc. |
| group | String | Logical grouping (e.g., training, validation, test), extensible, used for frontend column splitting or filtering. |
| group_by | Array of strings | Specifies which data point fields are used for grouping to generate multiple series (e.g., ["layer", "feature"]). |
| x_axis | String | Explicitly specifies the data point field name to be used as the X-axis (e.g., "step", "epoch", "timestamp"). |
| tags | Array of strings | Logical grouping (e.g., surface loss), used for frontend grouping or filtering. |
| unit | String | Unit (e.g., %, samples/sec), used for display purposes only. |
| data | Object | Data point array, strictly sorted in ascending order by time/step. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_msg | String | Error message |
| error_code | String | Error code |
| error_solution | String | Solution |
Example Requests
The following shows how to query a training job whose UUID is 3faf5c03-aaa1-4cbe-879d-24b05d997347.
GET https://{endpoint}/v2/{project_id}/training-jobs/3faf5c03-aaa1-4cbe-879d-24b05d997347/ft-metrics Example Responses
Status code: 200
Metric details
{
"train_process" : 1.0
} Status code: 400
Format of the body for a common error response. The following shows the returned information when a training job with ID 3f5d6706-7b67-408d-8ba0-ec08048c45ee is not found.
{
"error_msg" : "Job not found.",
"error_code" : "ModelArts.2755",
"error_solution" : "Check whether the training job in the request is valid."
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Metric details |
| 400 | Format of the body for a common error response. The following shows the returned information when a training job with ID 3f5d6706-7b67-408d-8ba0-ec08048c45ee is not found. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot