1

我正在尝试使用顶点 ai 构建 MLOps 管道,但未能部署它

@dsl.pipeline(
    # Default pipeline root. You can override it when submitting the pipeline.
    pipeline_root=PIPELINE_ROOT,
    # A name for the pipeline. Use to determine the pipeline Context.
    name="pipeline-test-1",
)
def pipeline(
serving_container_image_uri: str = "us-docker.pkg.dev/cloud-aiplatform/prediction/tf2-cpu.2-3:latest"
):
    dataset_op = get_data()
    train_op = train_xgb_model(dataset_op.outputs["dataset_train"])
    train_knn = knn_model(dataset_op.outputs["dataset_train"])
    
    eval_op = eval_model(
        test_set=dataset_op.outputs["dataset_test"],
        xgb_model=train_op.outputs["model_artifact"],
        knn_model=train_knn.outputs['best_model_artifact']
    )
    
    endpoint_op = gcc_aip.ModelDeployOp(
    project=PROJECT_ID,
    model=eval_op.outputs["model_artifacts"],
    machine_type="n1-standard-4",
    )
    
    #endpoint_op.after(eval_op)
    
compiler.Compiler().compile(pipeline_func=pipeline,
        package_path='xgb_pipe.json')

gcc_aip.ModelDeployOp 抛出错误,应该传递正确的模型 ID 或名称

4

0 回答 0