Train a TensorFlow model locally

In this quickstart, we will train a TensorFlow model with the MNIST dataset locally in Visual Studio Tools for AI.

The MNIST database has a training set of 60,000 examples, and a test set of 10,000 examples of handwritten digits.

Prerequisites

Before you begin, ensure you have the following installed:

Google TensorFlow

Run the following command in a terminal:

C:\>pip.exe install tensorflow

NumPy and SciPy

Install NumPy and SciPy.

Download sample code

Download this GitHub repository containing samples for getting started with deep learning across TensorFlow, CNTK, Theano, and more.

Open solution and train model

  • Launch Visual Studio and select File > Open > Project/Solution.

  • Select the Tensorflow Examples folder from the samples repository downloaded and open the TensorflowExamples.sln file.

    Open project

    Open solution

  • Find the MNIST project in Solution Explorer, right-click and select Set as StartUp Project.

  • Click Start.

  • The output is printed in the console.

    Sample output from console