az ml batch-endpoint
Note
This reference is part of the ml extension for the Azure CLI (version 2.15.0 or higher). 该扩展会在首次运行 az ml batch-endpoint 命令时自动安装。 Learn more about extensions.
管理 Azure ML 批处理终结点。
Azure ML 终结点提供用于创建和管理模型部署的简单界面。 每个终结点可以有一个或多个部署。 批处理终结点用于脱机批处理评分。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az ml batch-endpoint create |
创建终结点。 |
Extension | GA |
az ml batch-endpoint delete |
删除终结点。 |
Extension | GA |
az ml batch-endpoint invoke |
调用终结点。 |
Extension | GA |
az ml batch-endpoint list |
列出工作区中的终结点。 |
Extension | GA |
az ml batch-endpoint list-jobs |
列出批处理终结点的批处理评分作业。 |
Extension | GA |
az ml batch-endpoint show |
显示终结点的详细信息。 |
Extension | GA |
az ml batch-endpoint update |
更新终结点。 |
Extension | GA |
az ml batch-endpoint create
创建终结点。
若要创建终结点,请提供具有批处理终结点配置的 YAML 文件。 如果终结点已存在,则会使用新设置过度写入该终结点。
az ml batch-endpoint create --resource-group
--workspace-name
[--file]
[--name]
[--no-wait]
[--set]
示例
从 YAML 规范文件创建终结点
az ml batch-endpoint create --file endpoint.yml --resource-group my-resource-group --workspace-name my-workspace
创建具有名称的终结点
az ml batch-endpoint create --name endpointname --resource-group my-resource-group --workspace-name my-workspace
必需参数
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>
。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
包含 Azure ML 批处理终结点规范的 YAML 文件的本地路径。 可以在以下位置找到批处理终结点的 YAML 参考文档:https://aka.ms/ml-cli-v2-endpoint-batch-yaml-reference。
批处理终结点的名称。
不要等待长时间运行的操作完成。 默认值为 False。
属性 | 值 |
---|---|
默认值: | False |
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=value。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az ml batch-endpoint delete
删除终结点。
az ml batch-endpoint delete --name
--resource-group
--workspace-name
[--no-wait]
[--yes]
示例
删除批处理终结点,包括其所有部署
az ml batch-endpoint delete --name my-batch-endpoint --resource-group my-resource-group --workspace-name my-workspace
必需参数
批处理终结点的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>
。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
不要等待长时间运行的操作完成。 默认值为 False。
属性 | 值 |
---|---|
默认值: | False |
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az ml batch-endpoint invoke
调用终结点。
可以通过使用某些数据调用终结点来启动批处理推理。 对于批处理终结点,调用将触发异步批处理评分作业。
az ml batch-endpoint invoke --name
--resource-group
--workspace-name
[--deployment-name]
[--experiment-name]
[--file]
[--input]
[--input-type]
[--inputs]
[--instance-count]
[--job-name]
[--mini-batch-size]
[--output-path]
[--outputs]
[--set]
示例
使用已注册的 Azure ML 数据资产中的输入数据调用批处理终结点,并替代mini_batch_size的默认部署设置
az ml batch-endpoint invoke --name my-batch-endpoint --input azureml:my-dataset:1 --mini-batch-size 64 --resource-group my-resource-group --workspace-name my-workspace
从公共 URI 调用包含输入文件的批处理终结点
az ml batch-endpoint invoke --name my-batch-endpoint --input-type uri_file --input https://pipelinedata.blob.core.windows.net/sampledata/mnist/0.png --resource-group my-resource-group --workspace-name my-workspace
从已注册的数据存储调用包含输入文件的批处理终结点
az ml batch-endpoint invoke --name my-batch-endpoint --input-type uri_file --input azureml://datastores/workspaceblobstore/paths/{path_to_data}/mnist/0.png --resource-group my-resource-group --workspace-name my-workspace
从公共 URI 调用包含输入文件夹的批处理终结点
az ml batch-endpoint invoke --name my-batch-endpoint --input-type uri_folder --input https://pipelinedata.blob.core.windows.net/sampledata/mnist --resource-group my-resource-group --workspace-name my-workspace
从已注册的数据存储调用包含输入文件夹的批处理终结点
az ml batch-endpoint invoke --name my-batch-endpoint --input-type uri_folder --input azureml://datastores/workspaceblobstore/paths/{path_to_data}/mnist --resource-group my-resource-group --workspace-name my-workspace
使用本地文件夹中的文件调用批处理终结点
az ml batch-endpoint invoke --name my-batch-endpoint --input ./mnist_folder --resource-group my-resource-group --workspace-name my-workspace
使用本地文件夹作为输入和输出路径调用批处理终结点,并在终结点调用期间覆盖某些批处理部署设置
az ml batch-endpoint invoke --name my-batch-endpoint --input ./mnist_folder --instance-count 2 --mini-batch-size 5 --output-path azureml://datastores/workspaceblobstore/paths/tests/output --resource-group my-resource-group --workspace-name my-workspace
必需参数
批处理终结点的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>
。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
要面向的部署的名称。
管道组件部署试验的名称。
用于批处理调用的文件的名称。
对用于批处理推理的输入数据的引用。 它可以是数据存储、公共 URI、已注册的数据资产或本地文件夹路径上的路径。
输入的类型,指定它是文件还是文件夹。 在数据存储或公共 URI 上使用路径时,请使用此选项。 支持的值:uri_folder、uri_file。
调用作业的输入字典。
将运行预测的实例数。
批处理调用的作业的名称。
将输入数据拆分为用于预测的每个微型批的大小。
将输出文件上传到的数据存储上的路径。
用于指定结果存储位置的字典。
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=value。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az ml batch-endpoint list
列出工作区中的终结点。
az ml batch-endpoint list --resource-group
--workspace-name
示例
列出工作区中的所有批处理终结点
az ml batch-endpoint list --resource-group my-resource-group --workspace-name my-workspace
列出工作区中的所有批处理终结点
az ml batch-endpoint list --resource-group my-resource-group --workspace-name my-workspace
使用 --query 参数对命令结果执行 JMESPath 查询,列出工作区中的所有批处理终结点。
az ml batch-endpoint list --query "[].{Name:name}" --output table --resource-group my-resource-group --workspace-name my-workspace
必需参数
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>
。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az ml batch-endpoint list-jobs
列出批处理终结点的批处理评分作业。
az ml batch-endpoint list-jobs --name
--resource-group
--workspace-name
示例
列出终结点的所有批处理评分作业
az ml batch-endpoint list-jobs --name my-batch-endpoint --resource-group my-resource-group --workspace-name my-workspace
必需参数
批处理终结点的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>
。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az ml batch-endpoint show
显示终结点的详细信息。
az ml batch-endpoint show --name
--resource-group
--workspace-name
示例
显示批处理终结点的详细信息
az ml batch-endpoint show --name my-batch-endpoint --resource-group my-resource-group --workspace-name my-workspace
使用 --query 参数对命令结果执行 JMESPath 查询,显示终结点的预配状态。
az ml batch-endpoint show -n my-endpoint --query "{Name:name,State:provisioning_state}" --output table --resource-group my-resource-group --workspace-name my-workspace
必需参数
批处理终结点的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>
。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az ml batch-endpoint update
更新终结点。
可以更新终结点的“description”、“tags”和“defaults”属性。 此外,可以将新部署添加到终结点,并且可以更新现有部署。
az ml batch-endpoint update --resource-group
--workspace-name
[--add]
[--defaults]
[--file]
[--force-string]
[--name]
[--no-wait]
[--remove]
[--set]
示例
从 YAML 规范文件更新终结点
az ml batch-endpoint update --name my-batch-endpoint --file updated_endpoint.yml --resource-group my-resource-group --workspace-name my-workspace
将新部署添加到现有终结点
az ml batch-endpoint update --name my-batch-endpoint --set defaults.deployment_name=depname --resource-group my-resource-group --workspace-name my-workspace
必需参数
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>
。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>
。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
更新终结点调用的默认设置内的deployment_name。
包含 Azure ML 批处理终结点规范的 YAML 文件的本地路径。 可以在以下位置找到批处理终结点的 YAML 参考文档:https://aka.ms/ml-cli-v2-endpoint-batch-yaml-reference。
使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | False |
批处理终结点的名称。
不要等待长时间运行的操作完成。 默认值为 False。
属性 | 值 |
---|---|
默认值: | False |
从列表中删除属性或元素。 示例: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>
。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |