AzureML - 如何从集群模型创建 Web 服务

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

我创建了一个推理管道,它使用 K-means 对一组数据进行聚类。从设计器运行时,它工作正常并返回输入数据的集群分配。一旦部署为 Web 服务,该服务总是返回一组空结果。有没有人设法做类似的事情?

Real-time Endpoint test - 0 items returned

K-means Clustering Model Realtime Inference Pipeline

Web Service Output Results_dataset

更新:4/22

在部署日志中我看到this Warning

消息取决于我是在生产模式还是开发测试模式下使用 AksCompute 实例。

在开发测试模式下,警告是:output_name WebServiceOutput0 存在于模式中,但不存在于数据中

在生产模式下,我得到:output_name output1 存在于模式中但不存在于数据中

兜兜转转,我返回的数据集中仍然没有得到任何东西。还记录了 MS 的支持票,所以如果他们帮助我,我会在这里发布答案。

更新:4/24

测试端点时的部署日志:

    Init: Graph has been loaded
    2023-04-24 17:32:43,725 | root | INFO | Users's init has completed successfully
2023-04-24 17:32:43,726 | root | INFO | Skipping middleware: dbg_model_info as it's not enabled.
2023-04-24 17:32:43,726 | root | INFO | Skipping middleware: dbg_resource_usage as it's not enabled.
Found swagger file: /var/azureml-app/swagger.json
Swagger file loaded.
2023-04-24 17:32:43,733 | root | INFO | Scoring timeout is found from os.environ: 60000 ms
2023-04-24 17:32:50,235 | root | INFO | 200
127.0.0.1 - - [24/Apr/2023:17:32:50 +0000] "GET /swagger.json HTTP/1.0" 200 3301 "-" "-"
2023-04-24 17:32:53,910 | root | INFO | Scoring Timer is set to 60.0 seconds
Handling http request - Start:
2023-04-24 17:32:53,911 studio.azureml.designer.serving.dagengine.request_handler INFO       |   Run: is_classic = False, with_details = False, verbose = True
2023-04-24 17:32:53,911 studio.core          INFO       |   Pre-processing - Start:
2023-04-24 17:32:53,911 studio.core          INFO       |   Pre-processing - End with 0.0001s elapsed.
2023-04-24 17:32:53,912 studio.core          INFO       |   Processing - Start:
2023-04-24 17:32:53,932 studio.core          INFO       |   Processing - End with 0.0207s elapsed.
2023-04-24 17:32:53,933 studio.core          INFO       |   Post-processing - Start:
2023-04-24 17:32:53,933 studio.azureml.designer.serving.dagengine.processor WARNING    |   |   output_name WebServiceOutput0 exists in schema but not in data
2023-04-24 17:32:53,934 studio.core          INFO       |   Post-processing - End with 0.0006s elapsed.
2023-04-24 17:32:53,934 studio.core          INFO       Handling http request - End with 0.0235s elapsed.
2023-04-24 17:32:53,940 studio.azureml.designer.serving.dagengine.request_handler DEBUG      Run: output data(raw) = {"Results": {}}
2023-04-24 17:32:53,941 | root | INFO | run() output is HTTP Response
2023-04-24 17:32:53,941 | root | INFO | 200
127.0.0.1 - - [24/Apr/2023:17:32:53 +0000] "POST /score?verbose=true HTTP/1.0" 200 15 "-" "-"
2023-04-24 17:33:04,283 | root | INFO | 200
127.0.0.1 - - [24/Apr/2023:17:33:04 +0000] "GET /swagger.json HTTP/1.0" 200 3301 "-" "-"
2023-04-24 17:33:11,437 | root | INFO | 200
127.0.0.1 - - [24/Apr/2023:17:33:11 +0000] "GET /swagger.json HTTP/1.0" 200 3301 "-" "-"
2023-04-24 17:33:12,932 | root | INFO | Scoring Timer is set to 60.0 seconds
2023-04-24 17:33:12,932 studio.core          INFO       Handling http request - Start:
2023-04-24 17:33:12,932 studio.azureml.designer.serving.dagengine.request_handler INFO       |   Run: is_classic = False, with_details = False, verbose = True
2023-04-24 17:33:12,932 studio.core          INFO       |   Pre-processing - Start:
2023-04-24 17:33:12,933 studio.core          INFO       |   Pre-processing - End with 0.0001s elapsed.
2023-04-24 17:33:12,933 studio.core          INFO       |   Processing - Start:
2023-04-24 17:33:12,949 studio.core          INFO       |   Processing - End with 0.0163s elapsed.
2023-04-24 17:33:12,949 studio.core          INFO       |   Post-processing - Start:
2023-04-24 17:33:12,949 studio.azureml.designer.serving.dagengine.processor WARNING    |   |   output_name WebServiceOutput0 exists in schema but not in data
2023-04-24 17:33:12,949 studio.core          INFO       |   Post-processing - End with 0.0001s elapsed.
2023-04-24 17:33:12,949 studio.core          INFO       Handling http request - End with 0.0170s elapsed.
2023-04-24 17:33:12,949 studio.azureml.designer.serving.dagengine.request_handler DEBUG      Run: output data(raw) = {"Results": {}}
2023-04-24 17:33:12,950 | root | INFO | run() output is HTTP Response
2023-04-24 17:33:12,950 | root | INFO | 200
127.0.0.1 - - [24/Apr/2023:17:33:12 +0000] "POST /score?verbose=true HTTP/1.0" 200 15 "-" "-"
2023-04-24 17:42:24,397 | root | INFO | 200
127.0.0.1 - - [24/Apr/2023:17:42:24 +0000] "GET /swagger.json HTTP/1.0" 200 3301 "-" "-"
k-means azure-machine-learning-service azure-ml-pipelines
1个回答
0
投票

部署到实时端点时,计算类型有两个选项。

1.AksCompute

2.Azure Container实例

喜欢下面

enter image description here

我尝试部署实时推理管道。 在这两个选项中。 它工作成功。这是结果。

enter image description here

此端点使用 Azure 容器实例并且

enter image description here

这是使用 AksCompute 的另一个端点。 这是我的网络服务输出结果。

enter image description here

和实时推理管道。

enter image description here

尝试使用两种计算选项创建端点。

要使用 AksCompute 创建,请按照以下步骤操作。

首先,您需要创建 kubernates 集群。 转到 Ml studio 工作区中的Compute,然后单击

enter image description here

然后选择 AksCompute 选项。 在下一页中选择位置和 VM。

enter image description here

单击高级设置旁边。

enter image description here

如果您用于开发目的,请提供计算名称并选择Dev-test。然后点击Create。 创建需要一些时间。

现在让我们部署实时推理管道。 提交推理管道后,作业开始运行,您将获得如下 Web 服务输出和选项。

enter image description here

在这里你可以找到部署选项,点击它。

enter image description here

接下来,您将获得如上的选项。 选择部署新的实时端点。 为端点命名,然后选择 AksCompute 作为计算类型,并从下拉列表中选择您之前在 Kubernetes 集群中创建的计算名称。 然后单击部署,部署将开始,这需要一些时间来部署。

部署后在端点Test选项卡中测试结果,否则您使用Postman使用端点URLAuthentication Key

enter image description here 此部署使用 AksCompute 并尝试使用 Azure 容器服务。 部署时,只需选择容器服务作为计算类型,然后单击部署。

如果您仍然得到空结果,请转到端点中的部署日志,在那里您可以找到管道运行的日志和如下所示的结果。 在那里你可以看到哪里出了问题。

2023-04-20 19:18:08,363 studio.module        INFO       |   |   |   |   Select column indexes from Dataset
2023-04-20 19:18:08,365 studio.core          DEBUG      |   |   |   |   return:
2023-04-20 19:18:08,365 studio.core          DEBUG      |   |   |   |   |   [0] = <DataTable (3 Rows, 1 Cols) at 0x00007FD783962430>
2023-04-20 19:18:08,365 studio.core          INFO       |   |   |   SelectColumnsModule.run - End with 0.0085s elapsed.
2023-04-20 19:18:08,365 studio.core          INFO       |   |   Executing node 4: Select Columns in Dataset - End with 0.0116s elapsed.
2023-04-20 19:18:08,373 studio.core          INFO       |   Processing - End with 0.1412s elapsed.
2023-04-20 19:18:08,374 studio.core          INFO       |   Post-processing - Start:
2023-04-20 19:18:08,374 studio.core          INFO       |   Post-processing - End with 0.0000s elapsed.
2023-04-20 19:18:08,374 studio.core          INFO      
Handling http request - End with 0.1420s elapsed.
2023-04-20 19:18:08,374 studio.azureml.designer.serving.dagengine.request_handler DEBUG      Run: output data(raw) = {"Results": {"WebServiceOutput0": [{"Assignments": 1}, {"Assignments": 0}, {"Assignments": 2}]}}
2023-04-20 19:18:08,374 | root | INFO | run() output is HTTP Response
2023-04-20 19:18:08,374 | root | INFO | 200
127.0.0.1 - - [20/Apr/2023:19:18:08 +0000] "POST /score?verbose=true HTTP/1.0" 200 96 "-" "-"
© www.soinside.com 2019 - 2024. All rights reserved.