NOTICE: Azure Machine Learning Workbench (Preview) is deprecated. The workflow for deploying models, images and services has been updated since this question was posted.
我一直在使用Azure机器学习工作台(预览版)为Azure机器学习服务开发机器学习模型 . 我成功地将模型部署为Web服务,如Azure Machine Learning Documentation (Preview)中所述 . 我已设法启动并运行服务,并且模型,清单和图像都已正确配置 . 到现在为止还挺好 .
但现在我已经到了我希望能够使用新配置更新服务的阶段 . 这就是我发现自己有更多问题而不是答案的地方 .
我发现我可以
-
配置新模型
-
配置指向该模型的新清单
-
配置指向该清单的新图像
-
更新现有(或创建新)服务以指向新图像
这似乎足够合理 . 但是如果我只需要更新清单,是否可以跳过新模型的配置(1),并从上面的(2)开始更新,并让它指向现有模型而不是新模型一?
我当然通过从CLI调用以下内容来尝试这一点,并且我遇到了以下输出:
>> az ml manifest create --manifest-name manifestname -f score.py -r python -c aml_config/conda_dependencies.yml -s outputs/schema.json -i [existing-model-id]
Creating new driver at /var/folders/tmp/tmp.py
Successfully created manifest
Id: [manifest-id]
>> az ml image create -n imagename --manifest-id [manifest-id-from-above]
Creating image............................................Done.
Image ID: [image-id]
>> az ml service update realtime -i [existing-service-id] --image-id [image-id-from-above] -v
Updating service..................................Failed
Found default kubeconfig in /Users/username/.kube/config using it
Using kubeconfig file: /Users/username/.kube/config
Kubectl exists in default location, adding it to PATH
loading kubeconfig file
Getting Replica sets from default namespace
Got hash ####
{
"Azure-cli-ml Version": null,
"Error": "Error occurred",
"Response Content": {
"CreatedTime": "2018-09-17T13:31:22.4230543Z",
"EndTime": "2018-09-17T13:34:18.0774994Z",
"Error": {
"Code": "KubernetesDeploymentFailed",
"Details": [
{
"Code": "CrashLoopBackOff",
"Message": "Back-off 40s restarting failed container=### pod=###"
}
],
"Message": "Kubernetes Deployment failed",
"StatusCode": 400
},
"Id": "###",
"OperationType": "Service",
"ResourceLocation": "###",
"State": "Failed"
},
"Response Headers": {
"Connection": "keep-alive",
"Content-Encoding": "gzip",
"Content-Type": "application/json; charset=utf-8",
"Date": "Mon, 17 Sep 2018 13:34:22 GMT",
"Strict-Transport-Security": "max-age=15724800; includeSubDomains; preload",
"Transfer-Encoding": "chunked",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "SAMEORIGIN",
"api-supported-versions": "2017-09-01-preview, 2018-04-01-preview",
"x-ms-client-request-id": "###",
"x-ms-client-session-id": ""
}
}
如果我尝试回滚到上一个清单,则没有错误消息,一切正常 . 这让我觉得我的新清单和/或图像有问题 . 但是,创建它们时没有警告或错误 .
我试过搜索错误消息,但我一无所获 .
1 回答
CrashLoopBackOff错误通常意味着您的score.py文件的init()函数存在问题,例如,查找或加载模型 . 它也可能意味着您正在使用尚未导入的库 . Azure ML刚刚宣布使用更新的Python SDK(https://docs.microsoft.com/en-us/azure/machine-learning/service/quickstart-get-started)更新预览版 . 有一些教程和笔记本通过示例更详细地显示了该过程 . 我会从那里开始 .
https://docs.microsoft.com/en-us/azure/machine-learning/service/tutorial-deploy-models-with-aml