Skip to content

isabella232/AzureML-fastai

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use FastAI with Azure Machine Learning!

This repository has examples showing you how to use FastAI on Azure ML.

Create an ML workspace

The Azure Machine Learning workspace is the top-level resource for the service. It provides you with a centralized place to work with all the artifacts you create.

You can create an ML workspace by clicking here - specify a unique resource group name for your Azure subscription!:

Deploy To Azure

More details about deployment in the button used above, Check out ARM JSON definition and Azure Machine Learning VM sizes

Quick FastAI Environment setup

  1. Go to the Azure ML studio (https://ml.azure.com) and find your ML workspace.

  2. On the left side, select Notebooks. Select any notebook located in the User files section on the left-hand side. If you don't have any notebooks there, first create a notebook

Notebook

  1. Select the Open terminal icon. Open Terminal

  2. If you don't see the icon, select the ... to the right of the compute target and then select Open terminal . Open Terminal Mini

PRO-TIP: Copy and Paste in Terminal

  • Windows: Ctrl-c to copy is supported but use Shift-insert to paste.
  • FireFox/IE may not support clipboard permissions properly.
  • Mac OS: Cmd-c to copy and Cmd-v to paste.
  1. Copy the following command to clipboard:
wget https://raw.githubusercontent.com/Azure/AzureML-fastai/main/fastaionAMLCI.sh
bash fastaionAMLCI.sh

If you don't already have fastai, then you have to wait for the libraries and dependencies to install. Wait up to 10 mins for this to complete and continue to the next step.

All of the notebook samples should now be cloned into the fastai folder and ready to run!

  1. Refresh File Explorer to see all new files.

Refresh File Explorer

  1. If you didn't run into any errors, proceed to Running FastAI Notebook section

Manual FastAI Environment Setup

  1. Use the terminal window to create a new environment. For example, the code below creates fastaienv and activate the environment:
conda create -y --name fastaienv
conda activate fastaienv
  1. Install fastai, nbdev, pip and ipykernel package to the new environment and create a kernel for that conda env:
conda install -y pip
conda install -y ipykernel
conda install -y -c fastai -c pytorch fastai
conda install -y -c fastai fastbook
conda install -y -c fastai nbdev

If you don't already have fastai, then you have to wait for the libraries and dependencies to install. Wait up to 10 mins for this to complete and continue to the next step.

  1. Create a kernel for that conda env:
python -m ipykernel install --user --name fastaienv --display-name "Python (fastaienv)"
  1. Clone the Fast AI Repo with below snippet:
git clone https://github.com/fastai/fastai.git

All of the notebook samples should now be cloned into the fastai folder and ready to run!

  1. Refresh File Explorer to see all new files.

Refresh File Explorer

Running FastAI Notebooks

  1. Open a notebook in fastai/nbs you just cloned:

Open Notebooks

  1. Always make sure you select the Python (fastaienv) Kernel:

Fast AI Kernel

  1. Run all cells in Notebook:

Run All

Shutting down your compute

When you're down make sure you stop your compute! If you don't you'll keep getting charged until you click the stop compute button. Shutdown Compute

Returning back to work

When you want to go back to your notebook exercises, just find the notebook in the AzureML Studio and hit Play on any cell.

It will take a few mins to reboot your compute and run you cell. Make sure you have selected the Python (fastaienv) kernel when you notebook is running.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Example code showing how to run FastAI examples on Azure ML

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%