Install Tensorflow Python 3.7 Windows

-->

This tutorial shows how to locally train and evaluate a real-time object detection model in a UWP application. The model will be trained with TensorFlow locally on your machine through the DirectML APIs, which provides GPU accelerated training across all Windows devices. The trained model will then be integrated into a UWP app which uses your webcam to detect objects in the frame in real-time, locally using Windows ML APIs.

The latter was used with Python 2.7. It is now finally time to install TensorFlow. Run the windows command prompt as an administrator. To do so, go to the start menu on your Windows machine, search for 'cmd', right click it and choose 'Run as administrator'. After that, you only have to run one simple command to install TensorFlow.

We'll start by enabling TensorFlow on your machine.

If you'd like to learn how to train your model with TensorFlow, you can proceed to Train a Model.

  • Install Tensorflow Python 3.7 Windows 10. After successful installation, it is important to know the sample program execution of TensorFlow. Following example helps us understand the basic program creation “Hello World” in TensorFlow. Install Tensorflow Python 3.7 Windows 10. The code for first program implementation is mentioned below −.
  • Steps to Install TensorFlow. The installation part will consist of two parts: – Installing Anaconda; Setting up TensorFlow using Anaconda Prompt. Part 1: Install Anaconda on Windows. Anaconda is a bundle of some popular python packages and has a package manager called conda (similar to pip).

If you have a TensorFlow model, but want to learn how to convert it to an ONNX format suitable for use with WinML APIs, see convert your model.

If you have a model and want to learn how to create a WinML app from scratch, navigate to Deploy your model.

Enable GPU acceleration for TensorFlow with DirectML

Installing Tensorflow On Windows

To enable TensorFlow on your machine, proceed through the following steps.

Check your version of Windows

The TensorFlow with DirectML package on native Windows works on Windows 10 Version 1709 (Build 16299) or later versions of Windows. You can check your build version number by running winver via the Run command (Windows logo key + R).

Check for GPU driver updates

Ensure you have the latest GPU driver installed. Select Check for updates in the Windows Update section of the Settings app.

Set up the TensorFlow with DirectML preview

For use with TensorFlow, e recommend setting up a virtual Python environment inside Windows. There are many tools you can use to setup a virtual Python environment — for these instructions, we'll use Anaconda’s miniconda. The rest of this setup assumes you use a miniconda environment.

Set up Python environment

Download Tensorflow For Windows

Note

In the commands below, we use Python 3.6. However, the tensorflow-directml package works in a Python 3.5, 3.6 or 3.7 environment.

Download and install the Miniconda Windows installer on your machine. If you need it, there is additional guidance for setup on Anaconda’s site. Once Miniconda is installed, create an environment using Python named directml and activate it through the following commands:

conda create --name directml python=3.6conda activate directml

Install the Tensorflow with DirectML package

Note

Tensor

The tensorflow-directml package only supports TensorFlow 1.15.

Install the TensorFlow with DirectML package through pip by running the following command:

Download Tensorflow Python

pip install tensorflow-directml

Verify package installation

How To Download Tensorflow

Once you’ve installed the tensorflow-directml package, you can verify that it runs correctly by adding two tensors. Copy the following lines into an interactive Python session:

You should see output similar to the following, with the add operator placed on the DML device.

Next Steps

Now that you've gotten your prerequisites sorted out, you can proceed to creation of your WinML model. In the next part, you'll use TensorFlow to create your real-time object-detection model.

Important

TensorFlow, the TensorFlow logo and any related marks are trademarks of Google Inc.