在尝试使用 Mlflow 和 Docker 将模型部署到 Sagemaker 上时,存储库实际上不存在

问题描述 投票:0回答:0

我尝试使用此视频作为参考(正确的时间码)来部署我的第一个 ML 模型:https://youtu.be/FsoSBsrcx9Q?t=2801

一切正常,直到 deploy.py,我更改了视频中的代码,然后在命令行中我刚刚执行了 .py 并弹出此错误:

“名称为‘mlflow-pyfunc’的存储库在 ID 为‘’的注册表中不存在”

或者,如果我查看 ECR,它确实存在: enter image description here

不知道怎么办

视频中的版本是 mlflow 1.18.0,目前是 mlflow 2.2.2,所以我相信文档已更改。这是我用来部署模型的代码:

import mlflow.sagemaker as mfs
from mlflow.deployments import get_deploy_client


experiment_id = ''
run_id = ''
region = ''
aws_id = ''
arn = ''
app_name = 'btcprediction'
model_uri = f'mlruns/{experiment_id}/{run_id}/artifacts/rnn-btc-forecast'
tag_id = '2.2.2'

image_url = aws_id + '.dkr.ecr.' + region + '.amazonaws.com/mlflow-pyfunc:' + tag_id

config = dict(execution_role_arn=arn, image_url=image_url)
client = get_deploy_client("sagemaker")
client.create_deployment(name=app_name, model_uri=model_uri)

好像有用

amazon-web-services docker amazon-sagemaker aws-code-deploy mlflow
© www.soinside.com 2019 - 2024. All rights reserved.