This following Tutorial will take you through the deployment of Azure Machine Learning (AML) service using TensorFlow along with the entire Machine Learning development lifecycle of explore data, train, tune, and publish.
All student get $100 of Azure credit via Azure for Student for more details and get registered see Azure Dev Tools for teaching
You can get MNIST dataset (train.tfrecords, test.tfrecords) in this example by running the following code, https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/examples/how_tos/reading_data/convert_to_records.py
Microsoft Research Open Data Beta - Is a collection of free datasets from Microsoft Research to advance state-of-the-art research in areas such as natural language processing, computer vision, and domain specific sciences. Download or copy directly to a cloud-based Data Science Virtual Machine for a seamless development experience. see https://msropendata.com/
You can simply add any new data sets into your data
folder.
- Exercise01 : Prepare Config Settings
- Exercise02 : Prepare Datastore
- Exercise03 : Just Train in Your Working Machine
- Exercise04 : Train on Remote GPU Virtual Machine
- Exercise05 : Distributed Training
- Exercise06 : Experimentation Logs and Outputs
- Exercise07 : Hyperparameter Tuning
- Exercise08 : Publish as a Web Service
Before starting, you must provision your environment as follows :
-
Create Data Science Virtual Machine DSVM on Ubuntu (which also includes Azure ML CLI) using Azure Portal
Here we use DSVM, but you can also build your own environment from scratch.
You will have to run some commands after the initial install to update your DSVM application and libararies
# Fetches the list of available updates
sudo apt-get update
# Strictly upgrades the current packages
sudo apt-get upgrade
# Installs updates (new ones)
sudo apt-get dist-upgrade
or you can do it all nicely with this single script
sudo bash -c 'for i in update {,dist-}upgrade auto{remove,clean}; do apt-get $i -y; done'
- Create conda virtual environment and activate as follows.
conda create -n myenv -y Python=3.6
# Update Conda Environment
conda update -n base -c defaults conda
conda activate myenv
- Install required packages in your conda environment (You must run in your conda env.) so please ensure you have used the command conda activate myenv
In the next step we will install azureml-sdk[notebooks]
installs notebook in your conda env and azureml_widgets
extension (which is used in Exercise06) this Notebook extension is enabled in Jupyter. (See installed extension using jupyter nbextension list
.)
# install AML SDK
pip install azureml-sdk[notebooks]
# install notebook integration for conda
conda install nb_conda
# install required packages for development
# (use "tensorflow-gpu" if using GPU VM)
conda install -y matplotlib tensorflow
Create new "Machine Learning services workspace" using Azure Portal see Creating Azure ML Workspace Please make sure that you must specify location (region) which supports NC-series (K80 GPU) virtual machines in workspace creation, because workspace location is used when you create AML compute resources (virtual machines) in AML Python SDK. (See here for supported regions.)
Azure Container Instances offers the fastest and simplest way to run a container in Azure, without having to provision any virtual machines and without having to adopt a higher-level service. Learn how to create and manage container instances with our quickstarts, tutorials, and samples
- Remove azure-ml-admin-cli extension on VM as follows. (This extension is already installed on DSVM and prevents you from running
az login
command.)
sudo -i az extension remove --name azure-ml-admin-cli
- Login to Azure using CLI
az login
- Check to see if ACI provider is already registered
az provider show -n Microsoft.ContainerInstance -o table
- If ACI is not registered, run the following command. (You should be the subscription owner to run this command.)
az provider register -n Microsoft.ContainerInstance
- Start jupyter notebook server in your conda environment.
jupyter notebook
-
Copy url for notebook in the console output, and set SSH tunnel (port forwarding) on your desktop to access notebook. For instance, the following picture is the SSH tunnel setting on "putty" terminal client in Windows. (You can use
ssh -L
option in Mac OS.) -
Open your notebook url (http://localhost:8888/?token=...) using web browser in your desktop.
Simply paste into the password or token box the token recieved and press login this will load the Jupyter Hub
- Create new notebook by selecting "Python 3.6" kernel (which is your current conda environment).
Now you're ready to start !
- All student get $100 of Azure credit via Azure for Student for more details and get registered see Azure Dev Tools for teaching
- Azure Machine Learning โ Notebooks & Resources
- Using Azure Machine Learning Services - Tutorial and Documentation
- Azure Containers Docs and Tutorials
- Data Science Virtual Machine DSVM