You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/service/how-to-deploy-and-where.md
+66-66Lines changed: 66 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,45 +43,45 @@ For more information on the concepts involved in the deployment workflow, see [M
43
43
44
44
- The [Azure CLI extension for Machine Learning service](reference-azure-machine-learning-cli.md), or the [Azure Machine Learning Python SDK](https://aka.ms/aml-sdk).
45
45
46
-
## <aid="registermodel"></a> Register ML models
46
+
## <aid="registermodel"></a> Register your model
47
47
48
48
Register your machine learning models in your Azure Machine Learning workspace. The model can come from Azure Machine Learning or can come from somewhere else. The following examples demonstrate how to register a model from file:
49
49
50
50
### Register a model from an Experiment Run
51
51
52
-
**Scikit-Learn example with the CLI**
53
-
```azurecli-interactive
54
-
az ml model register -n sklearn_mnist --asset-path outputs/sklearn_mnist_model.pkl --experiment-name myexperiment
55
-
```
56
-
**Using the SDK**
57
-
```python
58
-
model = run.register_model(model_name='sklearn_mnist', model_path='outputs/sklearn_mnist_model.pkl')
description="MNIST image classification CNN from ONNX Model Zoo",)
79
+
```
80
+
81
+
+**Using the CLI**
82
+
```azurecli-interactive
83
+
az ml model register -n onnx_mnist -p mnist/model.onnx
84
+
```
85
85
86
86
**Time estimate**: Approximately 10 seconds.
87
87
@@ -218,53 +218,53 @@ The following sections demonstrate how to create the deployment configuration, a
218
218
219
219
## Deploy to target
220
220
221
-
### <aid="local"></a> Deploy locally
221
+
### <aid="local"></a> Local
222
222
223
223
The examples in this section use [deploy_from_image](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice(class)?view=azure-ml-py#deploy-from-model-workspace--name--models--image-config--deployment-config-none--deployment-target-none-), which requires you to register the model and image before doing a deployment. For more information on other deployment methods, see [deploy](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice(class)?view=azure-ml-py#deploy-workspace--name--model-paths--image-config--deployment-config-none--deployment-target-none-) and [deploy_from_model](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice(class)?view=azure-ml-py#deploy-from-model-workspace--name--models--image-config--deployment-config-none--deployment-target-none-).
224
224
225
225
**To deploy locally, you need to have Docker installed on your local machine.**
Use Azure Container Instances for deploying your models as a web service if one or more of the following conditions is true:
245
245
- You need to quickly deploy and validate your model.
246
246
- You are testing a model that is under development.
247
247
248
248
To see quota and region availability for ACI, see the [Quotas and region availability for Azure Container Instances](https://docs.microsoft.com/azure/container-instances/container-instances-quotas) article.
service = Model.deploy(ws, "aciservice", [model], inference_config, deployment_config)
255
+
service.wait_for_deployment(show_output=True)
256
+
print(service.state)
257
+
```
258
258
259
-
**Using the CLI**
259
+
+**Using the CLI**
260
260
261
-
```azurecli-interactive
262
-
az ml model deploy -m sklearn_mnist:1 -n aciservice -ic inferenceconfig.json -dc deploymentconfig.json
263
-
```
261
+
```azurecli-interactive
262
+
az ml model deploy -m sklearn_mnist:1 -n aciservice -ic inferenceconfig.json -dc deploymentconfig.json
263
+
```
264
264
265
265
For more information, see the reference documentation for the [AciWebservice](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.aciwebservice?view=azure-ml-py) and [Webservice](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.webservice?view=azure-ml-py) classes.
266
266
267
-
### <aid="aks"></a> Deploy to Azure Kubernetes Service (PRODUCTION)
267
+
### <aid="aks"></a>Azure Kubernetes Service (PRODUCTION)
268
268
269
269
You can use an existing AKS cluster or create a new one using the Azure Machine Learning SDK, CLI, or the Azure portal.
270
270
@@ -273,24 +273,24 @@ You can use an existing AKS cluster or create a new one using the Azure Machine
273
273
If you already have an AKS cluster attached, you can deploy to it. If you have NOT created or attached an AKS cluster go <ahref="#create-attach-aks">here</a>.
service = Model.deploy(ws, "aksservice", [model], inference_config, deployment_config, aks_target)
282
+
service.wait_for_deployment(show_output=True)
283
+
print(service.state)
284
+
print(service.get_logs())
285
+
```
286
286
287
-
Learn more about AKS deployment and autoscale in the [AksWebservice.deploy_configuration](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.akswebservice) reference.
287
+
Learn more about AKS deployment and autoscale in the [AksWebservice.deploy_configuration](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.akswebservice) reference.
288
288
289
-
**Using the CLI**
289
+
+**Using the CLI**
290
290
291
-
```azurecli-interactive
292
-
az ml model deploy -ct myaks -m mymodel:1 -n aksservice -ic inferenceconfig.json -dc deploymentconfig.json
293
-
```
291
+
```azurecli-interactive
292
+
az ml model deploy -ct myaks -m mymodel:1 -n aksservice -ic inferenceconfig.json -dc deploymentconfig.json
293
+
```
294
294
295
295
#### Create a new AKS cluster<aid="create-attach-aks"></a>
0 commit comments