TensorFlow 2
This tutorial shows how to activate TensorFlow 2 on an instance running the Deep Learning AMI with Conda (DLAMI on Conda) and run a TensorFlow 2 program.
When a stable Conda package of a framework is released, it's tested and pre-installed on the DLAMI.
Activating TensorFlow 2
To run TensorFlow on the DLAMI with Conda
-
To activate TensorFlow 2, open an Amazon Elastic Compute Cloud (Amazon EC2) instance of the DLAMI with Conda.
-
For TensorFlow 2 and Keras 2 on Python 3 with CUDA 10.1 and MKL-DNN, run this command:
$
source activate tensorflow2_p310 -
Start the iPython terminal:
(tensorflow2_p310)$
ipython -
Run a TensorFlow 2 program to verify that it is working properly:
import tensorflow as tf hello = tf.constant('Hello, TensorFlow!') tf.print(hello)
Hello, TensorFlow!
should appear on your screen.
More Tutorials
For more tutorials and examples, see the TensorFlow documentation for the TensorFlow Python API