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
One the scoring script is created, it's time to create a batch deployment for it. Follow the following steps to create it:
151
151
152
+
1. Ensure you have a compute cluster created where we can create the deployment. In this example we are going to use a compute cluster named `gpu-cluster`. Althought isnot required, we will GPUs to speed up the processing.
153
+
152
154
1. We need to indicate over which environment we are going to run the deployment. In our case, our model runs on `TensorFlow`. Azure Machine Learning already has an environment with the required software installed, so we can reutilize this environment. We are just going to add a couple of dependencies in a `conda.yml`file.
153
155
154
156
# [Azure CLI](#tab/cli)
@@ -264,7 +266,7 @@ For testing our endpoint, we are going to use a sample of 1000 images from the o
264
266
# [Python](#tab/sdk)
265
267
266
268
```python
267
-
data_path="/tmp/imagenet-1000"
269
+
data_path="data"
268
270
dataset_name="imagenet-sample-unlabeled"
269
271
270
272
imagenet_sample= Data(
@@ -419,16 +421,17 @@ On those cases, we may want to perform inference on the entire batch of data. Th
1. You can use this new deployment with the sample data shown before. Remember that to invoke this deployment you should either indicate the name of the deployment in the invocation method orset it as the default one.
422
425
423
426
## Considerations for MLflow models processing images
424
427
425
-
MLflow models in Batch Endpoints support reading images asinput data. Remember that MLflow models don't require a scoring script. Have the following considerations when using them:
428
+
MLflow models in Batch Endpoints support reading images asinput data. Since MLflow deployments don't require a scoring script, have the following considerations when using them:
>* MLflow models should expect to recieve a `np.ndarray`asinput that will match the dimensions of the input image. In order to support multiple image sizes on each batch, the batch executor will invoke the MLflow model once per image file.
430
433
>* MLflow models are highly encouraged to include a signature, andif they do it must be of type`TensorSpec`. Inputs are reshaped to match tensor's shape if available. If no signature is available, tensors of type `np.uint8` are inferred.
431
-
>* For models that include a signature and are expected to handle variable size of images, then include a signature that can guarantee it. For instance, the following signature will allow batches of 3 channeled images. Specify the signature when you register the model with`mlflow.<flavor>.log_model(..., signature=signature)`.
434
+
>* For models that include a signature and are expected to handle variable size of images, then include a signature that can guarantee it. For instance, the following signature example will allow batches of 3 channeled images.
For more information about how to use MLflow models in batch deployments read [Using MLflow models in batch deployments](how-to-mlflow-batch.md).
452
+
You can find a working example in the Jupyter notebook [imagenet-classifier-mlflow.ipynb](https://github.com/Azure/azureml-examples/blob/main/sdk/python/endpoints/batch/deploy-models/imagenet-classifier/imagenet-classifier-mlflow.ipynb). For more information about how to use MLflow models in batch deployments read [Using MLflow models in batch deployments](how-to-mlflow-batch.md).
0 commit comments