Menu
Deep Learning AMI
Developer Guide

TensorFlow

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

To run TensorFlow on the DLAMI with Conda

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

    • For TensorFlow and Keras 2 on Python 3 with CUDA 8, run this command:

      $ source activate tensorflow_p36
    • For TensorFlow and Keras 2 on Python 2 with CUDA 8, run this command:

      $ source activate tensorflow_p27
  2. Start the iPython terminal:

    (tensorflow_p36)$ ipython
  3. Run a TensorFlow program to verify that it is working properly:

    import tensorflow as tf hello = tf.constant('Hello, TensorFlow!') sess = tf.Session() print(sess.run(hello))

    Hello, TensorFlow! should appear on your screen.

More Info

TensorBoard

TensorFlow Serving

For tutorials, see the folder called Deep Learning AMI with Conda tutorialsin the home directory of the DLAMI.

For even more tutorials and examples, see the TensorFlow documentation for the TensorFlow Python API, and visit the TensorFlow website.

On this page: