ModelLifeCycle 使用 Amazon CLI 示例进行调用 - 亚马逊 SageMaker AI
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

ModelLifeCycle 使用 Amazon CLI 示例进行调用

您可以使用该 Amazon CLI 工具来管理您的 Amazon 资源。提供了几条 Amazon CLI 命令,包括 searchlist-actions。以下页面中的示例演示了在使用这些命令时,如何使用 ModelPackage。有关设置阶段构造的信息和示例,请参阅设置阶段构造示例

此页面上的示例使用以下变量。

  • region 是您的模型包所在的区域。

  • stage-name 是您定义的阶段的名称。

  • stage-status 是您定义的阶段状态的名称。

以下是使用的示例 Amazon CLI 命令 ModelLifeCycle。

使用您已经定义的stage-name搜索您的模型包。

aws sagemaker search --region 'region' --resource ModelPackage --search-expression '{"Filters": [{"Name": "ModelLifeCycle.Stage","Value": "stage-name"}]}'

列出与 ModelLifeCycle 关联的操作。

aws sagemaker list-actions --region 'region' --action-type ModelLifeCycle

使用创建模型包 ModelLifeCycle。

aws sagemaker create-model-package --model-package-group-name 'model-package-group-name' --source-uri 'source-uri' --region 'region' --model-life-cycle '{"Stage":"stage-name", "StageStatus":"stage-status", "StageDescription":"Your Staging Comment"}'

使用更新模型包 ModelLifeCycle。

aws sagemaker update-model-package --model-package 'model-package-arn' --region 'region' --model-life-cycle '{"Stage":"stage-name", "StageStatus":"stage-status"}'

通过该 ModelLifeCycle 字段进行搜索。

aws sagemaker search --region 'region' --resource ModelPackage --search-expression '{"Filters": [{"Name": "ModelLifeCycle.Stage","Value": "stage-name"}]}'

通过获取审核记录以获取 ModelLifeField 更新亚马逊 SageMaker ML 血统追踪 APIs。

aws sagemaker list-actions --region 'region' --action-type ModelLifeCycle
aws sagemaker describe-action --region 'region' --action-name 'action-arn or action-name'