[英]How to update Sagemaker Endpoint with the newly Trained Model?
I am able to train a model on Sagemaker and then deploy a model endpoint out of it.我能够在 Sagemaker 上训练一个 model,然后从中部署一个 model 端点。
Now, I want to retrain my model every week with the new data that is coming in. My question is - when I retrain the model how do I update my existing endpoint to use the latest model. (I don't want to deploy a new endpoint)现在,我想每周用新数据重新训练我的 model。我的问题是 - 当我重新训练 model 时,我如何更新我现有的端点以使用最新的 model。(我不想部署一个新端点)
From some exploration, I think I can do it in 2 ways -通过一些探索,我认为我可以通过两种方式做到这一点 -
Near the end of the training job, I create a new EndpointConfig
and later use UpdateEndpoint - The downside of this would be - I would end up with a lot of unnecessary Endpoint Configurations in my AWS Account?在训练工作接近尾声时,我创建了一个新的
EndpointConfig
并稍后使用UpdateEndpoint - 这样做的缺点是 - 我最终会在我的 AWS 账户中得到很多不必要的端点配置? Or am I thinking about it wrongly?还是我想错了?
Near the end of the training job, I deploy the trained model using .deploy()
and set update_endpoint=True
as illustrated in Sagemaker SDK Doc在培训工作接近尾声时,我使用
.deploy()
部署经过培训的 model 并设置update_endpoint=True
,如Sagemaker SDK Doc中所示
I am not sure which is the better solution to accomplish this?我不确定哪个是实现此目标的更好解决方案? Is there an even better way to do this?
有没有更好的方法来做到这一点?
If you are interested in doing this programmatically, use an AWS SDK (I will answer this assuming you are using Java.如果您有兴趣以编程方式执行此操作,请使用 AWS SDK(假设您使用的是 Java,我会回答这个问题。
Look the AWS SDK for Java V2 Javadocs.在 AWS SDK 中查找 Java V2 Javadocs。 You can use the UpdateEndpoint to perform this use case.
您可以使用UpdateEndpoint来执行此用例。 This method deploys the new EndpointConfig specified in the request, switches to using newly created endpoint, and then deletes resources provisioned for the endpoint using the previous EndpointConfig (there is no availability loss).
此方法部署请求中指定的新 EndpointConfig,切换到使用新创建的端点,然后删除使用以前的 EndpointConfig 为端点配置的资源(没有可用性损失)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.