Skip to content

Commit 53e34be

Browse files
authored
Merge pull request #103002 from luisquintanilla/AB1668714
AML | Updates to VS Code Tutorial Based on Feedback
2 parents bae6129 + e0c85f6 commit 53e34be

File tree

5 files changed

+70
-36
lines changed

5 files changed

+70
-36
lines changed
49.5 KB
Loading
355 KB
Loading
38.6 KB
Loading

articles/machine-learning/tutorial-setup-vscode-extension.md

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Tutorial: Set up Azure Machine Learning Visual Studio Code extension"
2+
title: "Tutorial: Set up the Visual Studio Code extension"
33
titleSuffix: Azure Machine Learning
44
description: Learn how to set up the Visual Studio Code Azure Machine Learning extension.
55
services: machine-learning
@@ -8,8 +8,8 @@ ms.subservice: core
88
ms.topic: tutorial
99
author: luisquintanilla
1010
ms.author: luquinta
11-
ms.date: 01/16/2019
12-
#Customer intent: As a professional data scientist, I want to learn how to get started with the Azure Machine Learning Visual Studio Code Extension.
11+
ms.date: 02/24/2020
12+
#Customer intent: As a professional data scientist, I want to Learn how to install and run scripts using the Azure Machine Learning Visual Studio Code extension.
1313
---
1414

1515
# Set up Azure Machine Learning Visual Studio Code extension
@@ -26,7 +26,8 @@ In this tutorial, you learn the following tasks:
2626
## Prerequisites
2727

2828
- Azure subscription. If you don't have one, sign up to try the [free or paid version of Azure Machine Learning](https://aka.ms/AMLFree).
29-
- Install [Visual Studio Code](https://code.visualstudio.com/docs/setup/setup-overview), a lightweight, cross-platform code editor.
29+
- Visual Studio Code. If you don't have it, [install it](https://code.visualstudio.com/docs/setup/setup-overview).
30+
- [Python 3](https://www.python.org/downloads/)
3031

3132
## Install the extension
3233

@@ -35,6 +36,9 @@ In this tutorial, you learn the following tasks:
3536
1. In the Extensions view, search for "Azure Machine Learning".
3637
1. Select **Install**.
3738

39+
> [!div class="mx-imgBorder"]
40+
> ![Install Azure Machine Learning VS Code Extension](./media/tutorial-setup-vscode-extension/install-aml-vscode-extension.PNG)
41+
3842
> [!NOTE]
3943
> Alternatively, you can install the Azure Machine Learning extension via the Visual Studio Marketplace by [downloading the installer directly](https://aka.ms/vscodetoolsforai).
4044
@@ -45,9 +49,9 @@ The rest of the steps in this tutorial have been tested with **version 0.6.8** o
4549
In order to provision resources and run workloads on Azure, you have to sign in with your Azure account credentials. To assist with account management, Azure Machine Learning automatically installs the Azure Account extension. Visit the following site to [learn more about the Azure Account extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account).
4650

4751
1. Open the command palette by selecting **View > Command Palette** from the menu bar.
48-
1. Enter the command "Azure: Sign In" into the text box to start the sign in process.
52+
1. Enter the command "Azure: Sign In" into the command palette to start the sign in process.
4953

50-
## Run a script in Azure
54+
## Run a machine learning model training script in Azure
5155

5256
Now that you have signed into Azure with your account credentials, Use the steps in this section to learn how to use the extension to train a machine learning model.
5357

@@ -75,16 +79,16 @@ Now that you have signed into Azure with your account credentials, Use the steps
7579
7680
```json
7781
{
78-
"workspace": "WS12191742",
79-
"resourceGroup": "WS12191742-rg2",
82+
"workspace": "WS01311608",
83+
"resourceGroup": "WS01311608-rg1",
8084
"location": "South Central US",
81-
"experiment": "WS12191742-exp2",
85+
"experiment": "WS01311608-exp1",
8286
"compute": {
83-
"name": "WS12191742-com2",
87+
"name": "WS01311608-com1",
8488
"vmSize": "Standard_D1_v2, Cores: 1; RAM: 3.5GB;"
8589
},
8690
"runConfiguration": {
87-
"filename": "WS12191742-com2-rc1",
91+
"filename": "WS01311608-com1-rc1",
8892
"condaDependencies": [
8993
"python=3.6.2",
9094
"tensorflow=1.15.0"
@@ -96,8 +100,38 @@ Now that you have signed into Azure with your account credentials, Use the steps
96100
}
97101
```
98102
99-
1. Select **Submit experiment** to run your experiment in Azure. This sends the `train.py` and configuration file to your Azure Machine Learning workspace. The training job is then started on a compute resource in Azure.
100-
1. After several minutes, a directory called `output` is created locally containing a trained TensorFlow model.
103+
1. Once you're satisfied with your configuration, submit your experiment by opening the command palette and entering the following command:
104+
105+
```text
106+
Azure ML: Submit Experiment
107+
```
108+
109+
This sends the `train.py` and configuration file to your Azure Machine Learning workspace. The training job is then started on a compute resource in Azure.
110+
111+
### Track the progress of the training script
112+
113+
Running your script can take several minutes. To track its progress:
114+
115+
1. Select the **Azure** icon from the activity bar.
116+
1. Expand your subscription node.
117+
1. Expand your currently running experiment's node. This is located inside the `{workspace}/Experiments/{experiment}` node where the values for your workspace and experiment are the same as the properties defined in the configuration file.
118+
1. All of the runs for the experiment are listed, as well as their status. To get the most recent status, click the refresh icon at the top of the Azure Machine Learning View.
119+
120+
> [!div class="mx-imgBorder"]
121+
> ![Track Experiment Progress](./media/tutorial-setup-vscode-extension/track-experiment-progress.PNG)
122+
123+
### Download the trained model
124+
125+
When the experiment run is complete, the output is a trained model. To download the outputs locally:
126+
127+
1. Right-click the most recent run and select **Download Outputs**.
128+
129+
> [!div class="mx-imgBorder"]
130+
> ![Download Trained Model](./media/tutorial-setup-vscode-extension/download-trained-model.PNG)
131+
132+
1. Select a location where to save the outputs to.
133+
1. A folder with the name of your run is downloaded locally. Navigate to it.
134+
1. The model files are inside the `outputs/outputs/model` directory.
101135
102136
## Next steps
103137

articles/machine-learning/tutorial-train-deploy-image-classification-model-vscode.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Tutorial: Train and deploy an image classification TensorFlow model using the Azure Machine Learning Visual Studio Code Extension"
2+
title: "Tutorial: Train and deploy a model using the Visual Studio Code extension"
33
titleSuffix: Azure Machine Learning
44
description: Learn how to train and deploy an image classification model using TensorFlow and the Azure Machine Learning Visual Studio Code Extension
55
services: machine-learning
@@ -8,13 +8,13 @@ ms.subservice: core
88
ms.topic: tutorial
99
author: luisquintanilla
1010
ms.author: luquinta
11-
ms.date: 01/16/2019
12-
#Customer intent: As a professional data scientist, I want to develop, deploy, and manage Azure Machine Learning projects locally in Visual Studio Code.
11+
ms.date: 02/24/2020
12+
#Customer intent: As a professional data scientist, I want to learn how to train and deploy an image classification model using TensorFlow and the Azure Machine Learning Visual Studio Code Extension.
1313
---
1414

1515
# Train and deploy an image classification TensorFlow model using the Azure Machine Learning Visual Studio Code Extension
1616

17-
Learn how to train an image classification model to recognize hand-written numbers using TensorFlow and the Azure Machine Learning Visual Studio Code Extension.
17+
Learn how to train and deploy an image classification model to recognize hand-written numbers using TensorFlow and the Azure Machine Learning Visual Studio Code Extension.
1818

1919
In this tutorial, you learn the following tasks:
2020

@@ -52,11 +52,11 @@ The first thing you have to do to build an application in Azure Machine Learning
5252
> [!div class="mx-imgBorder"]
5353
> ![Create a workspace](./media/tutorial-train-deploy-image-classification-model-vscode/create-workspace.png)
5454
55-
1. By default a name is generated containing the date and time of creation. In the command palette, change the name to "TeamWorkspace" and press **Enter**.
56-
1. Select **Create a new resource group** in the command palette.
57-
1. Enter "TeamWorkspace-rg" in the command palette text box and press **Enter**.
58-
1. In the command palette, choose a location for your workspace. It's recommended to choose a location that is closest to the location you plan to deploy your model. In this case, choose **West US 2**.
59-
1. When prompted to select a workspace SKU, select **Basic** to create a basic workspace. For more information on different workspace offerings, see [Azure Machine Learning overview](./overview-what-is-azure-ml.md#sku).
55+
1. By default a name is generated containing the date and time of creation. In the text input box, change the name to "TeamWorkspace" and press **Enter**.
56+
1. Select **Create a new resource group**.
57+
1. Name your resource group "TeamWorkspace-rg" and press **Enter**.
58+
1. Choose a location for your workspace. It's recommended to choose a location that is closest to the location you plan to deploy your model. For example, "West US 2".
59+
1. When prompted to select the type of workspace, select **Basic** to create a basic workspace. For more information on different workspace offerings, see [Azure Machine Learning overview](./overview-what-is-azure-ml.md#sku).
6060

6161
At this point, a request to Azure is made to create a new workspace in your account. After a few minutes, the new workspace appears in your subscription node.
6262

@@ -73,7 +73,7 @@ One or more experiments can be created in your workspace to track and analyze in
7373
> [!div class="mx-imgBorder"]
7474
> ![Create an experiment](./media/tutorial-train-deploy-image-classification-model-vscode/create-experiment.png)
7575
76-
1. In the command palette prompt, name your experiment "MNIST" and press **Enter** to create the new experiment.
76+
1. Name your experiment "MNIST" and press **Enter** to create the new experiment.
7777

7878
Like workspaces, a request is sent to Azure to create an experiment with the provided configurations. After a few minutes, the new experiment appears in the *Experiments* node of your workspace.
7979

@@ -92,8 +92,8 @@ To create a compute target:
9292
> ![Create a compute target](./media/tutorial-train-deploy-image-classification-model-vscode/create-compute.png)
9393
9494
1. Select **Azure Machine Learning Compute (AmlCompute)**. Azure Machine Learning Compute is a managed-compute infrastructure that allows the user to easily create a single or multi-node compute that can be used with other users in your workspace.
95-
1. Choose a VM size. In the command palette prompt, select **Standard_F2s_v2**. The size of your VM has an impact on the amount of time it takes to train your models. For more information on VM sizes, see [sizes for Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/linux/sizes).
96-
1. In the command palette prompt, name your compute "TeamWkspc-com" and press **Enter** to create your compute.
95+
1. Choose a VM size. Select **Standard_F2s_v2** from the list of options. The size of your VM has an impact on the amount of time it takes to train your models. For more information on VM sizes, see [sizes for Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/linux/sizes).
96+
1. Name your compute "TeamWkspc-com" and press **Enter** to create your compute.
9797

9898
After a few minutes, the new compute target appears in the *Compute* node of your workspace.
9999

@@ -111,10 +111,10 @@ To create a run configuration:
111111
> [!div class="mx-imgBorder"]
112112
> ![Create a run configuration](./media/tutorial-train-deploy-image-classification-model-vscode/create-run-configuration.png)
113113
114-
1. In the command palette prompt, name your run configuration "MNIST-rc" and press **Enter** to create your compute.
114+
1. Name your run configuration "MNIST-rc" and press **Enter** to create your run configuration.
115115
1. Then, select **TensorFlow Single-Node Training** as the training job type.
116116
1. Press **Enter** to browse the script file to run on the compute. In this case, the script to train the model is the `train.py` file inside the `vscode-tools-for-ai/mnist-vscode-docs-sample` directory.
117-
1. Enter the following into the command palette prompt to specify the required packages.
117+
1. Enter the following into the input box to specify the required packages.
118118

119119
```text
120120
pip: azureml-defaults; conda: python=3.6.2, tensorflow=1.15.0
@@ -188,7 +188,7 @@ To run an Azure Machine Learning experiment:
188188
> [!div class="mx-imgBorder"]
189189
> ![Run an experiment](./media/tutorial-train-deploy-image-classification-model-vscode/run-experiment.png)
190190
191-
1. In the command palette, select the **TeamWkspc-com** compute target.
191+
1. From the list of compute target options, select the **TeamWkspc-com** compute target.
192192
1. Then, select the **MNIST-rc** run configuration.
193193
1. At this point, a request is sent to Azure to run your experiment on the selected compute target in your workspace. This process takes several minutes. The amount of time to run the training job is impacted by several factors like the compute type and training data size. To track the progress of your experiment, right-click the current run node and select **View Run in Azure portal**.
194194
1. When the dialog requesting to open an external website appears, select **Open**.
@@ -218,9 +218,9 @@ To register your model:
218218
> [!div class="mx-imgBorder"]
219219
> ![Register a model](./media/tutorial-train-deploy-image-classification-model-vscode/register-model.png)
220220
221-
1. On the command palette, name your model "MNIST-TensorFlow-model" and press **Enter**.
222-
1. A TensorFlow model is made up of several files. Select **Model folder** as the model path format in the command palette.
223-
1. Select the `azureml_outputs/Run_1/outputs/Run_1/outputs/outputs/model` directory.
221+
1. Name your model "MNIST-TensorFlow-model" and press **Enter**.
222+
1. A TensorFlow model is made up of several files. Select **Model folder** as the model path format from the list of options.
223+
1. Select the `azureml_outputs/Run_1/outputs/outputs/model` directory.
224224
225225
A file containing your model configurations appears in Visual Studio Code with similar content to the one below:
226226
@@ -230,7 +230,7 @@ To register your model:
230230
"tags": {
231231
"": ""
232232
},
233-
"modelPath": "c:\\Dev\\vscode-tools-for-ai\\mnist-vscode-docs-sample\\azureml_outputs\\Run_1\\outputs\\Run_1\\outputs\\outputs\\model",
233+
"modelPath": "c:\\Dev\\vscode-tools-for-ai\\mnist-vscode-docs-sample\\azureml_outputs\\Run_1\\outputs\\outputs\\model",
234234
"description": ""
235235
}
236236
```
@@ -262,10 +262,10 @@ To deploy a web service as an ACI :
262262
> [!div class="mx-imgBorder"]
263263
> ![Deploy the model](./media/tutorial-train-deploy-image-classification-model-vscode/register-model.png)
264264
265-
1. On the command palette, select **Azure Container Instances**.
266-
1. Name your service "mnist-tensorflow-svc" and press **Enter** in the command palette.
267-
1. Choose the script to run in the container by pressing **Enter** in the command palette and browsing for the `score.py` file in the `mnist-vscode-docs-sample` directory.
268-
1. Provide the dependencies needed to run the script by pressing **Enter** in the command palette and browsing for the `env.yml` file in the `mnist-vscode-docs-sample` directory.
265+
1. Select **Azure Container Instances**.
266+
1. Name your service "mnist-tensorflow-svc" and press **Enter**.
267+
1. Choose the script to run in the container by pressing **Enter** in the input box and browsing for the `score.py` file in the `mnist-vscode-docs-sample` directory.
268+
1. Provide the dependencies needed to run the script by pressing **Enter** in the input box and browsing for the `env.yml` file in the `mnist-vscode-docs-sample` directory.
269269
270270
A file containing your model configurations appears in Visual Studio Code with similar content to the one below:
271271

0 commit comments

Comments
 (0)