diff --git a/how-to-use-azureml/automated-machine-learning/automl_env.yml b/how-to-use-azureml/automated-machine-learning/automl_env.yml index de003a18..7d79c70a 100644 --- a/how-to-use-azureml/automated-machine-learning/automl_env.yml +++ b/how-to-use-azureml/automated-machine-learning/automl_env.yml @@ -17,6 +17,7 @@ dependencies: - notebook - pywin32==227 - PySocks==1.7.1 +- jsonschema==4.5.1 - conda-forge::pyqt==5.12.3 - pip: diff --git a/how-to-use-azureml/machine-learning-pipelines/parallel-run/file-dataset-image-inference-mnist.ipynb b/how-to-use-azureml/machine-learning-pipelines/parallel-run/file-dataset-image-inference-mnist.ipynb index 9b1600b5..e5f60a87 100644 --- a/how-to-use-azureml/machine-learning-pipelines/parallel-run/file-dataset-image-inference-mnist.ipynb +++ b/how-to-use-azureml/machine-learning-pipelines/parallel-run/file-dataset-image-inference-mnist.ipynb @@ -361,7 +361,7 @@ "\n", "batch_conda_deps = CondaDependencies.create(python_version=\"3.7\",\n", " conda_packages=['pip==20.2.4'],\n", - " pip_packages=[\"tensorflow==1.15.2\", \"pillow\", \n", + " pip_packages=[\"tensorflow==1.15.2\", \"pillow\", \"protobuf==3.20.1\",\n", " \"azureml-core\", \"azureml-dataset-runtime[fuse]\"])\n", "batch_env = Environment(name=\"batch_environment\")\n", "batch_env.python.conda_dependencies = batch_conda_deps\n", diff --git a/tutorials/machine-learning-pipelines-advanced/scripts/batch_scoring.py b/tutorials/machine-learning-pipelines-advanced/scripts/batch_scoring.py index 72ab62a3..f4058ff6 100644 --- a/tutorials/machine-learning-pipelines-advanced/scripts/batch_scoring.py +++ b/tutorials/machine-learning-pipelines-advanced/scripts/batch_scoring.py @@ -5,17 +5,19 @@ import os import argparse import datetime import time -import tensorflow as tf +import tensorflow.compat.v1 as tf from math import ceil import numpy as np +import sys import shutil -from tensorflow.contrib.slim.python.slim.nets import inception_v3 +import subprocess +import tf_slim from azureml.core import Run from azureml.core.model import Model from azureml.core.dataset import Dataset -slim = tf.contrib.slim +slim = tf_slim image_size = 299 num_channel = 3 @@ -32,16 +34,18 @@ def get_class_label_dict(labels_dir): def init(): global g_tf_sess, probabilities, label_dict, input_images + subprocess.run(["git", "clone", "https://github.com/tensorflow/models/"]) + sys.path.append("./models/research/slim") parser = argparse.ArgumentParser(description="Start a tensorflow model serving") parser.add_argument('--model_name', dest="model_name", required=True) parser.add_argument('--labels_dir', dest="labels_dir", required=True) args, _ = parser.parse_known_args() - + from nets import inception_v3, inception_utils label_dict = get_class_label_dict(args.labels_dir) classes_num = len(label_dict) - - with slim.arg_scope(inception_v3.inception_v3_arg_scope()): + tf.disable_v2_behavior() + with slim.arg_scope(inception_utils.inception_arg_scope()): input_images = tf.placeholder(tf.float32, [1, image_size, image_size, num_channel]) logits, _ = inception_v3.inception_v3(input_images, num_classes=classes_num, diff --git a/tutorials/machine-learning-pipelines-advanced/tutorial-pipeline-batch-scoring-classification.ipynb b/tutorials/machine-learning-pipelines-advanced/tutorial-pipeline-batch-scoring-classification.ipynb index 999b9d3c..43989ae1 100644 --- a/tutorials/machine-learning-pipelines-advanced/tutorial-pipeline-batch-scoring-classification.ipynb +++ b/tutorials/machine-learning-pipelines-advanced/tutorial-pipeline-batch-scoring-classification.ipynb @@ -247,7 +247,7 @@ " config = AmlCompute.provisioning_configuration(vm_size=\"STANDARD_NC6\",\n", " vm_priority=\"lowpriority\", \n", " min_nodes=0, \n", - " max_nodes=1)\n", + " max_nodes=2)\n", "\n", " compute_target = ComputeTarget.create(workspace=ws, name=compute_name, provisioning_configuration=config)\n", " compute_target.wait_for_completion(show_output=True, min_node_count=None, timeout_in_minutes=20)" @@ -305,9 +305,10 @@ "from azureml.core.conda_dependencies import CondaDependencies\n", "from azureml.core.runconfig import DEFAULT_GPU_IMAGE\n", "\n", - "cd = CondaDependencies.create(python_version=\"3.7\",\n", + "cd = CondaDependencies.create(python_version=\"3.8\",\n", " conda_packages=['pip==20.2.4'],\n", - " pip_packages=[\"tensorflow-gpu==1.15.2\",\n", + " pip_packages=[\"tensorflow-gpu==2.3.0\",\n", + " \"tf_slim==1.1.0\", \"protobuf==3.20.1\",\n", " \"azureml-core\", \"azureml-dataset-runtime[fuse]\"])\n", "\n", "env = Environment(name=\"parallelenv\")\n",