azure-machine-learning-service - AML - Web 服务超时错误

标签 azure-machine-learning-service azure-aks

我们创建了一个 Web 服务端点,并使用以下代码和 POSTMAN 对其进行了测试。

我们将该服务部署到与 AML 资源相同的资源组和订阅中的 AKS。

更新:附加的 AKS 具有自定义网络配置并拒绝外部连接。

import numpy
import os, json, datetime, sys
from operator import attrgetter
from azureml.core import Workspace
from azureml.core.model import Model
from azureml.core.image import Image
from azureml.core.webservice import Webservice
from azureml.core.authentication import AzureCliAuthentication

cli_auth = AzureCliAuthentication()
# Get workspace
ws = Workspace.from_config(auth=cli_auth)

# Get the AKS Details
try:
    with open("../aml_config/aks_webservice.json") as f:
        config = json.load(f)
except:
    print("No new model, thus no deployment on AKS")
    # raise Exception('No new model to register as production model perform better')
    sys.exit(0)

service_name = config["aks_service_name"]
# Get the hosted web service
service = Webservice(workspace=ws, name=service_name)

# Input for Model with all features
input_j = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]]
print(input_j)
test_sample = json.dumps({"data": input_j})
test_sample = bytes(test_sample, encoding="utf8")
try:
    prediction = service.run(input_data=test_sample)
    print(prediction)
except Exception as e:
    result = str(e)
    print(result)
    raise Exception("AKS service is not working as expected")

在 AML Studio 中,部署状态为“正常”。

Endpoint attributes

测试时出现以下错误:

Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'

部署 AKS Web 服务后立即记录 here .

运行测试脚本后登录here .

我们如何知道导致此问题的原因并解决它?

最佳答案

您尝试过service.get_logs()吗?还请先尝试本地部署。 https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-local-container-notebook-vm

关于azure-machine-learning-service - AML - Web 服务超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62457880/

相关文章:

python - 从存储帐户安装私有(private) python 轮

azure - AKS 群集创建额外的路由表、额外的 NSG 并且不使用现有的自定义路由表和 NSG

azure - azure ml studio 数据文件中的分隔符

azure - 如何从 Azure DevOps 触发 AzureML Pipeline?

Kubernetes 部署不可公开访问

kubernetes - 从 Helm stable/cert-manager 升级到 jetstack/cert-manager

azure - 创建后可以在 Azure AKS 上启用 HTTP 应用程序路由吗?

azure - 使用K3s时如何从Azure容器注册表中提取图像?

python - 访问AzureML TabularDataset的底层jsonl文件

c# - 如何获取 Azure ML Web 服务提供的 HttpResponseMessage 中的预测分数?