0

我有这段代码来启动 VertexAI 管道作业:

import google.cloud.aiplatform as vertexai

vertexai.init(project=PROJECT_ID,staging_bucket=PIPELINE_ROOT)

job = vertexai.PipelineJob(
    display_name='pipeline-test-1',
    template_path='xgb_pipe.json'
)

job.run()

这很好用,但run name标签是一个随机数。我该如何指定run name

在此处输入图像描述

4

1 回答 1

0

name您可以通过定义管道时的定义来更改“运行名称”中显示的值。

@kfp.dsl.pipeline(name="automl-image-training-v2")

在定义nameusing@kfp.dsl.pipeline时,它会自动附加管道运行的日期和时间。继续编译和运行管道以查看“运行名称”中的更改。

在此处输入图像描述

我使用了Vertex AI pipeline examples中的代码。查看管道代码:

@kfp.dsl.pipeline(name="automl-image-training-v2")
def pipeline(project: str = PROJECT_ID, region: str = REGION):
    ds_op = gcc_aip.ImageDatasetCreateOp(
        project=project,
        display_name="flowers",
        gcs_source="gs://cloud-samples-data/vision/automl_classification/flowers/all_data_v2.csv",
        import_schema_uri=aip.schema.dataset.ioformat.image.single_label_classification,
    )

    training_job_run_op = gcc_aip.AutoMLImageTrainingJobRunOp(
        project=project,
        display_name="train-automl-flowers",
        prediction_type="classification",
        model_type="CLOUD",
        base_model=None,
        dataset=ds_op.outputs["dataset"],
        model_display_name="train-automl-flowers",
        training_fraction_split=0.6,
        validation_fraction_split=0.2,
        test_fraction_split=0.2,
        budget_milli_node_hours=8000,
    )

    endpoint_op = gcc_aip.EndpointCreateOp(
        project=project,
        location=region,
        display_name="train-automl-flowers",
    )

    gcc_aip.ModelDeployOp(
        model=training_job_run_op.outputs["model"],
        endpoint=endpoint_op.outputs["endpoint"],
        automatic_resources_min_replica_count=1,
        automatic_resources_max_replica_count=1,
    )
于 2021-11-10T06:34:37.687 回答