VertexAI 管道:提供的位置 ID 与端点不匹配

VertexAI Pipelines: The provided location ID doesn't match the endpoint

我已成功 运行 以下管道创建数据集、训练模型并使用 VertexAIs 管道工具部署到端点,当一切都基于 us-central1 时。现在,当我将区域更改为 europe-west2 时,出现以下错误:

debug_error_string = "{"created":"@1647430410.324290053","description":"Error received from peer
ipv4:172.217.169.74:443","file":"src/core/lib/surface/call.cc","file_line":1066,
"grpc_message":"List of found errors:\t1.Field: name; Message: 
The provided location ID doesn't match the endpoint. The valid location ID is `us-central1`.\t","grpc_status":3}"

此错误发生在 europe-west2 中创建数据集之后,模型开始训练之前。这是我的代码:

#import libraries
from typing import NamedTuple
import kfp
from kfp import dsl
from kfp.v2 import compiler
from kfp.v2.dsl import (Artifact, Input, InputPath, Model, Output, 
                        OutputPath, ClassificationMetrics, Metrics, component)
from kfp.v2.components.types.artifact_types import Dataset
from kfp.v2.google.client import AIPlatformClient
from google.cloud import aiplatform
from google_cloud_pipeline_components import aiplatform as gcc_aip
from google.api_core.exceptions import NotFound

@kfp.dsl.pipeline(name=f"lookalike-model-training-v2",
                  pipeline_root=PIPELINE_ROOT)
def pipeline(
    bq_source: str = f"bq://{PROJECT_ID}.{DATASET_ID}.{TABLE_NAME}",
    display_name: str = DISPLAY_NAME,
    project: str = PROJECT_ID,
    gcp_region: str = "europe-west2",
    api_endpoint: str = "europe-west2-aiplatform.googleapis.com",
    thresholds_dict_str: str = '{"auPrc": 0.5}',
):
            
    dataset_create_op = gcc_aip.TabularDatasetCreateOp(
        project=project,
        display_name=display_name, 
        bq_source=bq_source,
        location = gcp_region
    )

    training_op = gcc_aip.AutoMLTabularTrainingJobRunOp(
        project=project,
        display_name=display_name,
        optimization_prediction_type="classification",
        budget_milli_node_hours=1000,
        location=gcp_region,
        predefined_split_column_name="set",
        column_transformations=[
            {"categorical": {"column_name": "agentId"}},
            {"categorical": {"column_name": "postcode"}},
            {"categorical": {"column_name": "isMobile"}},
            {"categorical": {"column_name": "gender"}},
            {"categorical": {"column_name": "timeOfDay"}},
            {"categorical": {"column_name": "set"}},
            {"categorical": {"column_name": "sale"}},
        ],
        dataset=dataset_create_op.outputs["dataset"],
        target_column="sale",
    )

compiler.Compiler().compile(
    pipeline_func=pipeline, package_path="tab_classif_pipeline.json"
)

ml_pipeline_job = aiplatform.PipelineJob(
    display_name=f"{MODEL_PREFIX}_training",
    template_path="tab_classif_pipeline.json",
    pipeline_root=PIPELINE_ROOT,
    parameter_values={"project": PROJECT_ID, "display_name": DISPLAY_NAME},
    enable_caching=True,
    location="europe-west2"
)
ml_pipeline_job.submit()

如前所述,数据集已创建,因此我怀疑问题一定出在 training_op = gcc_aip.AutoMLTabularTrainingJobRunOp

我尝试提供另一个端点:eu-aiplatform.googleapis.com 产生了以下错误:

google.api_core.exceptions.InvalidArgument: 400 List of found errors: 1.Field: name; Message: 
The provided location ID doesn't match the endpoint. The valid location ID is `us-central1`.

Fail to send metric: [rpc error: code = PermissionDenied desc = Permission monitoring.metricDescriptors.create 
denied (or the resource may not exist).; rpc error: code = PermissionDenied desc = Permission monitoring.timeSeries.create
 denied (or the resource may not exist).]

我知道我没有将 api-endpoint 传递给上述任何方法,但我想我会强调错误略有变化。

有人知道问题出在哪里吗?或者我如何 运行 gcc_aip.AutoMLTabularTrainingJobRunOp 在 europe-west2(或一般的欧盟)?

谢谢

尝试使用以下命令更新管道组件:

pip3 install --force-reinstall google_cloud_pipeline_components==0.1.3