Resources for running Unity ML agent training in Azure
- Unity 3D with ML Agents
- An Azure account; get free Azure credits!
- The Azure CLI
- PowerShell or Bash
- Get started with Unity 3D ML Agents as described here
- Build your Unity project for Linux x86_64 as described here
- Copy
Editor/AzureDeploymentWindow.cs
into your project's Editor directory. - Use the
ML on Azure > Train
command to open the dialog - Optionally set the storage account name; a default name is provided based on the current time, but is not guaranteed to be unique
- Click
Choose build output
and navigate to your x86_64 build output. - Click
Deploy
; currently the editor only displays what you should run at the command line - Ensure you are logged into Azure (run
az login
) - Navigate to the
scripts
and run the command provided by the editor, e.g.,.\train-on-aci.ps1 -storageAccountName drunityml20180425 -environmentName 3dball -localVolume C:\code\ml-agents\unity-volume
scripts/train-on-aci.ps1
will do the following:
- Ensures the existence of a target Azure resource group
- Ensures the existence of a target Azure storage account and file share
- Uploads your Unity build to the file share
- Creates an Azure Container Instance to run the ML training using said Unity build, outputting to said file share
- For parameters, see comment based help in train-on-aci.ps1
scripts/train-on-aci.sh
will do the following:
- Ensures the existence of a target Azure resource group
- Ensures the existence of a target Azure storage account and file share
- Uploads your Unity build to the file share
- Creates an Azure Container Instance to run the ML training using said Unity build, outputting to said file share
- For parameters, see comment based help in train-on-aci.sh