使用 Python SDK 开始执行现有 SageMaker 管道

Mar*_*icz 3 aws-sdk amazon-sagemaker

SageMaker 文档解释了如何运行管道,但它假设我刚刚定义了它并且我有可用的对象pipeline

如何使用Python SDK运行现有管道?

我知道如何使用 AWS CLI 读取管道(即aws sagemaker describe-pipeline --pipeline-name foo)。Python 代码也能完成同样的事情吗?然后我就pipeline准备好了可以使用的对象。

小智 5

如果Pipeline已经创建,您可以使用Python Boto3 SDK进行StartPipelineExecutionAPI调用。

response = client.start_pipeline_execution(
    PipelineName='string',
    PipelineExecutionDisplayName='string',
    PipelineParameters=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    PipelineExecutionDescription='string',
    ClientRequestToken='string',
    ParallelismConfiguration={
        'MaxParallelExecutionSteps': 123
    }
)
Run Code Online (Sandbox Code Playgroud)

如果您更喜欢 AWS CLI,则最基本的调用是:

aws sagemaker start-pipeline-execution --pipeline-name <name-of-the-pipeline>
Run Code Online (Sandbox Code Playgroud)