GCP 的 Vertex AI(AI Platform) PipelineServiceClient 给出未实现的错误



当尝试列出PipelineServiceClientlist_pipeline_jobs方法的管道时,我得到以下错误:

_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNIMPLEMENTED
details = "Received http2 header with status: 404"
...

如何API未实现,我如何解决这个问题?

我们在这里遗漏了两件事:

  1. 我们需要初始化带有正确端点的客户端选项的PipelineServiceClient。这里给出了端点列表。格式为endpoint:port
  2. 我们需要给list_pipeline_jobs正确的请求。

示例:对于asia-south1区域,我们将编写如下调用:

import google.cloud.aiplatform as aip
from google.api_core.client_options import ClientOptions
aip.init(project='<PROJECT_NAME>',
staging_bucket='PROJECT_BUCKET',
location='asia-south1')
options = ClientOptions(
api_endpoint="asia-south1-aiplatform.googleapis.com:443")
cli = aip.gapic.PipelineServiceClient(client_options=options)
parent = cli.common_location_path(project='<PROJECT_NAME>', location='asia-south1')
request = aip.gapic.ListPipelineJobsRequest(
request=request
)
pipeline_jobs_pager = cli.list_pipeline_jobs(parent=parent) # returns a pager object
for page in pipeline_jobs_pager.pages:
for pipeline_job in page.pipeline_jobs:
print(pipeline_job.name)

注意:gapic可替换为v1v1beta1呼叫

相关内容

  • 没有找到相关文章

最新更新