What is Tensor Flow 2

TensorFlow 2

This tutorial shows how to enable TensorFlow 2 for an instance running Deep Learning AMI with Conda (DLAMI on Conda) and how to run a TensorFlow 2 program.

When a robust conda package of a framework is released, it is tested and preinstalled in the DLAMI. If you want to run the latest untested nightly build, you can manually run Install Nightly Build (Trial) of TensorFlow 2.

Activate TensorFlow 2

How to run TensorFlow on the DLAMI with Conda

  1. To activate TensorFlow 2, open an Amazon Elastic Compute Cloud (Amazon EC2) instance of the DLAMI with Conda.

  2. For TensorFlow 2 and Keras 2 under Python 3 with CUDA 10.1 and MKL-DNN run this command:

  3. Start the iPython terminal:

  4. Run a TensorFlow 2 program to make sure it is working properly:

    You should see on your screen.

Install Nightly Build (Trial Version) of TensorFlow 2

You can install the latest TensorFlow 2 build in either or both of the TensorFlow 2 Conda environments in your deep learning AMI with Conda.

How to install TensorFlow from a nightly build

  1. In the Python 3 TensorFlow 2 environment, run the following command:

  2. Remove the currently installed TensorFlow.

    The rest of the steps assume that you are using the environment.

  3. Install the latest nightly build of TensorFlow.

  4. To check that you have the latest nightly build installed, launch the IPython terminal and check the TensorFlow version.

    The printout should look something like this:

More tutorials

More tutorials can be found in the folder named in the root directory of the DLAMI.

For more tutorials and examples, see the TensorFlow documentation for the TensorFlow on API at the TensorFlow website.