Updated on 2024-03-21 GMT+08:00

Creating a Visualization Job

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.

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')

Parameters

Table 1 create_visualization_job request parameters

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.

Table 2 create_visualization_job response parameters

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.

Table 3 VisualizationJob parameters

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