在 aci 中部署机器学习模型时出现错误

时间:2021-07-29 12:39:50

标签: python azure azure-aks azure-machine-learning-studio azure-container-instances

我在尝试部署机器学习模型时遇到以下错误,当我上次(1 个月前)使用相同的 score.py 文件部署时,它已成功部署,谁能告诉我为什么现在出现错误< /strong>

错误信息如下

service.get_logs()

Received bad response from Model Management Service:
Response Code: 404
Headers: {'Date': 'Thu, 29 Jul 2021 12:34:55 GMT', 'Content-Type': 'application/json', 
'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Vary': 'Accept-Encoding', 'x-ms- 
client-request-id': '70679512-c060-4340-adb7-b48ce00449f5', 'x-ms-client-session-id': 
'1def55d9-4542-4b5b-b499-81aaa966e48a', 'api-supported-versions': '1.0, 2018-03-01-preview, 
2018-11-19', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains; preload', 'X- 
Content-Type-Options': 'nosniff', 'x-request-time': '0.961', 'Content-Encoding': 'gzip'}

**My deployment code is below**
aci_config = AciWebservice.deploy_configuration()

service = Model.deploy(workspace=ws,
                   name='try',
                   models=[model_x],
                   inference_config=inference_config,
                   deployment_config=aci_config,overwrite=True)
service.wait_for_deployment(show_output=True)

1 个答案:

答案 0 :(得分:0)

您尚未分享错误消息,因此我无法确定根本原因。但是我看到同样的错误发生在一个区域负载很重时,您可能会在部署实例时遇到失败。

要缓解此类部署失败,请尝试部署具有较低资源设置的实例,或者稍后或在具有可用资源的其他区域尝试部署。

尝试分配更少的资源,例如

<块引用>

aciconfig = AciWebservice.deploy_configuration(cpu_cores=1, memory_gb=8, 标签={“数据”:“文本”,“方法”:“NB”}, description='预测某事')

你可以试试。

参考:https://docs.microsoft.com/en-us/azure/container-instances/container-instances-region-availability

-宇通