зеркало из https://github.com/Azure/Azure-AI-Camp.git
Post run-through on student resources
This commit is contained in:
Родитель
268eb70953
Коммит
bc39c00276
|
@ -251,7 +251,9 @@
|
|||
"metadata": {},
|
||||
"source": [
|
||||
"### Deploy to ACI container\n",
|
||||
"We are ready to deploy. Create a deployment configuration file to specify the number of CPUs and gigabytes of RAM needed for your ACI container. While it depends on your model, the default of 1 core and 3 gigabyte of RAM is usually sufficient for many models. This cell will run for about 5-20 minutes."
|
||||
"We are ready to deploy. Create a deployment configuration file to specify the number of CPUs and gigabytes of RAM needed for your ACI container. While it depends on your model, the default of 1 core and 3 gigabyte of RAM is usually sufficient for many models. This cell will run for about 5-20 minutes.\n",
|
||||
"\n",
|
||||
"Note: service names must be unique. Delete service or rename if you wish to deploy another."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -404,7 +406,7 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# service.delete()"
|
||||
"service.delete()"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -440,7 +442,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.8"
|
||||
"version": "3.6.9"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Tip1: To ensure that the packages are installed into the correct kernel for a notebook we use `{sys.prefix}` for the path to the correct Python environment.\n",
|
||||
"Tip1: To ensure that the packages are installed into the correct kernel for a notebook we use `{sys.prefix}` (or `{sys.executable} -m`, alternatively) for the path to the correct Python environment.\n",
|
||||
"<br><br>\n",
|
||||
"Tip 2: It's a good idea to make sure the releases of `torch` and `torchvision` match (you can check on https://pypi.org/ for the release dates)."
|
||||
]
|
||||
|
@ -40,15 +40,24 @@
|
|||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Set warnings and logging level\n",
|
||||
"import warnings\n",
|
||||
"warnings.filterwarnings('ignore')\n",
|
||||
"\n",
|
||||
"import logging\n",
|
||||
"logger = logging.getLogger()\n",
|
||||
"logger.setLevel(logging.CRITICAL)\n",
|
||||
"\n",
|
||||
"# Install packages\n",
|
||||
"import sys\n",
|
||||
"\n",
|
||||
"# Install/upgrade the Azure ML SDK using: \n",
|
||||
"# pip and the correct Python kernel with sys.executable\n",
|
||||
"# ! {sys.executable} -m pip install --upgrade azureml-sdk[notebooks]==1.2.0\n",
|
||||
"! {sys.executable} -m pip install -q --upgrade azureml-sdk[notebooks,automl,contrib]==1.5.0\n",
|
||||
"# ! {sys.prefix}/bin/pip install matplotlib\n",
|
||||
"\n",
|
||||
"## If running locally or need to upgrade PyTorch - install PyTorch and Torchvision with\n",
|
||||
"! {sys.prefix}/bin/pip install --upgrade torch==1.3 torchvision==0.4.1 azureml-sdk[notebooks]==1.2.0"
|
||||
"! {sys.prefix}/bin/pip install -q --upgrade torch==1.3 torchvision==0.4.1"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -165,7 +174,7 @@
|
|||
" # Set min_nodes to 0 so that it scales down to 0 VMs when not is use to avoid incurring costs\n",
|
||||
" compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_NC6',\n",
|
||||
" min_nodes=0,\n",
|
||||
" max_nodes=2)\n",
|
||||
" max_nodes=1)\n",
|
||||
" # create the cluster\n",
|
||||
" compute_target = ComputeTarget.create(ws, cluster_name, compute_config)\n",
|
||||
" compute_target.wait_for_completion(show_output=True)"
|
||||
|
@ -282,7 +291,7 @@
|
|||
"# this should download a model on target compute)\n",
|
||||
"script_params = {\n",
|
||||
" '--data_dir': behavior_ds.as_named_input('behavior_ds_'+my_nickname).as_mount(),\n",
|
||||
" '--num_epochs': 30,\n",
|
||||
" '--num_epochs': 10,\n",
|
||||
" '--learning_rate': 0.01,\n",
|
||||
" '--output_dir': './outputs',\n",
|
||||
" '--transfer': 'True'\n",
|
||||
|
@ -315,7 +324,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Check run status. You can re-run this cell to recheck."
|
||||
"Check run status. You can re-run this cell to recheck. Training with the data provided through this notebook \"as-is\" will take ~30-40 minutes to complete."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -384,7 +393,11 @@
|
|||
"source": [
|
||||
"## Evaluate model\n",
|
||||
"\n",
|
||||
"You will need test images in the `test` folder in the following folder structure:\n",
|
||||
"- Get the test image (file: `caviar_test_images.zip`) from the Release page for this repo on GitHub (https://github.com/Azure/Azure-AI-Camp/releases).\n",
|
||||
"- Upload to the `Azure-AI-Camp/day1/2.1.ImageClassificationWithPyTorch/` folder\n",
|
||||
"- Unzip the file `unzip caviar_test_images.zip` on the command line (go to \"New\" and select \"Terminal\" from drop-down in Jupyterhub)\n",
|
||||
"\n",
|
||||
"You will need test images in a folder named `test` with the following folder structure:\n",
|
||||
"\n",
|
||||
"```\n",
|
||||
"\\test\n",
|
||||
|
@ -424,7 +437,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Data transforms with `torchvision`"
|
||||
"Data transforms with `torchvision` (similar to transforms during training minus any data augmentation)."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -585,7 +598,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.8"
|
||||
"version": "3.6.9"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
@ -4,16 +4,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.\n",
|
||||
"\n",
|
||||
"Licensed under the MIT License."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Azure ML and IoT Edge\n"
|
||||
"# Azure ML and IoT Edge\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -30,7 +21,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"import sys\n",
|
||||
"! {sys.executable} -m pip install -q --upgrade azureml-sdk[notebooks]==1.5.0"
|
||||
"! {sys.executable} -m pip install -q --upgrade azureml-sdk[notebooks,automl,contrib]==1.5.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -155,7 +146,7 @@
|
|||
"outputs": [],
|
||||
"source": [
|
||||
"# Load the IoT extension for Azure CLI if needed - may not work in the notebook so try in terminal if not\n",
|
||||
"# ! sudo az extension update --name azure-cli-iot-ext"
|
||||
"! sudo az extension add --name azure-cli-iot-ext"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -188,7 +179,9 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### 2.1 Provision an Edge VM"
|
||||
"### 2.1 Provision an Edge VM\n",
|
||||
"\n",
|
||||
"**IMPORTANT NOTE**: Before you proceed, you must perform a one-time task to accept the terms of the data science virtual machine on your Azure subscription. You can do this by visiting [Configure Programmatic Deployment](https://ms.portal.azure.com/#blade/Microsoft_Azure_Marketplace/LegalTermsSkuProgrammaticAccessBlade/legalTermsSkuProgrammaticAccessData/%7B%22product%22%3A%7B%22publisherId%22%3A%22microsoft_iot_edge%22%2C%22offerId%22%3A%22iot_edge_vm_ubuntu%22%2C%22planId%22%3A%22ubuntu_1604_edgeruntimeonly%22%7D%7D)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -216,7 +209,7 @@
|
|||
"source": [
|
||||
"### 2.2: Provision IoT Hub\n",
|
||||
"\n",
|
||||
"If you get an error because there's already one free hub in your subscription, change the SKU to S1. If you get an error that the IoT Hub name isn't available, it means that someone else already has a hub with that name. \n"
|
||||
"If you get an error because there's already one free hub in your subscription, change the SKU to S1. If you get an error that the IoT Hub name isn't available, it means that someone else already has a hub with that name so try a different name.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -614,7 +607,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.6.8"
|
||||
"version": "3.6.9"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
Загрузка…
Ссылка в новой задаче