Condividi tramite


Create an AI project from the Azure Machine Learning Gallery in Visual Studio

Azure Machine Learning is integrated with Visual Studio Tools for AI. You can use it to submit machine learning jobs to remote compute targets like Azure virtual machines, Spark clusters, and more.

Once you've installed Visual Studio Tools for AI, it's easy to create a new Python project using pre-made recipes in the Azure Machine Learning Sample Gallery.

Note

Azure Machine Learning Workbench must be installed.

  1. Launch Visual Studio. Open the Server Explorer by opening the AI Tools menu and choosing Select Cluster

    Cluster chooser

  2. Sign in to your Azure Machine Learning subscription by right-clicking the Azure Machine Learning node in the Server Explorer then select Login and follow the directions.

    login

  3. Select AI Tools > Azure Machine Learning Sample Gallery.

    Sample gallery

  4. For this Quickstart, select the "MNIST using TensorFlow" sample and click Install. Provide the following:

    • Resource Group: Azure resource group where your metadata will be stored
    • Account: Azure Machine Learning experimentation Account
    • Workspace: Azure Machine Learning workspace
    • Project Type: The machine learning framework. In this case choose TensorFlow
    • Add to Solution: determines whether to add to your current Visual Studio Solution or a create and open a new solution
    • Project Path: Location to save the code
    • Project Name: Type TensorFlowMNIST

    Resulting project when using the Python Application template

  5. Visual Studio creates the project file (a .pyproj file on disk) along with other files defined in the sample. With the "MNIST" template, the project contains several files.

    Screenshot of the Visual Studio Solution Explorer showing the files for the TensorFlowMNIST project. The code for tf_mnist.py is shown in the main window.

  6. Submit the job to Azure Machine Learning.

    Screenshot of the Visual Studio Solution Explorer showing the context menu for the TensorFlowMNIST project with "Submit Job…" selected.

  7. Run in a Docker container or on your local machine

    Screenshot of the Submit Job dialog with Use cluster set to "azureml:/local" and Startup script set to "tf_mnist.py".