部署ML模型后,调用服务时超时 [英] After deploying ML Model, got time out when call the service

查看:127
本文介绍了部署ML模型后,调用服务时超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的机器学习服务平台.我刚刚在ACI中部署了模型,该服务已成功启动.但是当我在很长一段时间后致电该服务时,我收到了超时消息:

I am new the machine learning service platform. I just deployed my model with it in ACI, and the service is up successfully. But when I call the service after a long time I got timeout message:

---------------------------------------------------------------------------WebserviceException Traceback (most recent call last) <ipython-input-17-59842372084d> in <module> 1 deals =[3,55,50] 2 request = json.dumps(deals)----> 3 response = service.run(input_data = request) 4 json.loads(response)["msg"]~/anaconda3_501/lib/python3.6/site-packages/azureml/core/webservice/aci.py in run(self, input_data) 211'Response Code: {}\n' 212'Headers: {}\n'--> 213 'Content: {}'.format(resp.status_code, resp.headers, resp.content)) 214 215 def update(self, image=None, tags=None, properties=None, description=None, auth_enabled=None, ssl_enabled=None, WebserviceException: Received bad response from service: Response Code: 504 Headers: {'X-Ms-Request-Id': 'd1f6ed8f-ff45-49dc-a68a-bf2a3aeb5de7', 'Date': 'Wed, 12 Dec 2018 23:10:58 GMT', 'Content-Length': '109', 'Content-Type': 'text/plain; charset=utf-8', 'X-Cache': 'MISS from ansprod7299nb', 'Via': '1.1 ansprod7299nb (squid/3.5.27)', 'Connection': 'keep-alive'}

...'

我确实希望很长时间才能运行模型.并在本地毫无问题地运行相同的代码.我也没有问题地在入门包中运行了示例代码.如果我让模型在运行前睡眠1个小时,则会看到相同的错误消息 如上.所以我得出结论,超时设置会引起问题(不是模型本身).我的问题是如何调整超时设置. MS建议解决方案是什么?谢谢.

I do expect long time to run the model. And ran the same code with no problem at the local. I also ran the sample code in the get started package with no problem. While if I let the model to sleep for 1 hour before run, I will see the same error message as above. so I conclude the time out setting cause the problem(not the model itself). My question is how can I tweak the timeout setting. what is MS suggestion solution to this? Thanks.

推荐答案

ACI服务的超时时间为1分钟,旨在用于快速的请求响应工作负载.

The ACI service has a timeout of 1 minute, it's designed for fast request-response workloads.

对于长时间运行的计分电话,建议使用批处理计分.

For longer-running scoring calls, the recommendation is to use batch scoring.

-Roope


这篇关于部署ML模型后,调用服务时超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆