doc-exports/docs/modelarts/sdk-ref/modelarts_04_0163.html
Lai, Weijian eda19245f1 modelarts sdk-ref version 21.430 update
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com>
Reviewed-by: Rechenburg, Matthias <matthias.rechenburg@t-systems.com>
Co-authored-by: Lai, Weijian <laiweijian4@huawei.com>
Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
2023-03-20 09:32:27 +00:00

14 KiB

Obtaining the Name of a Training Job Log File

Sample Code

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.

  • Method 1: Obtain the file based on the specified job_id and version_id.
    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()
    
  • Method 2: Obtain the file based on the training job created in Creating a Training Job.
    1
    job_log_list = job_instance.get_job_log_file_list()
    

Parameter Description

Table 1 Estimator request parameters

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. Obtain job_id using the training job object generated in Creating a Training Job, for example, job_instance.job_id, or from the response in Obtaining Training Jobs.

version_id

Yes

String

Version ID of a training job. Obtain version_id using the training job object generated in Creating a Training Job, for example, job_instance.version_id, or from the response in Obtaining Training Jobs.

Table 2 get_job_log_file_list response parameters

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 Error Codes in ModelArts API Reference.

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