TensorFlow 2 - Amazon Deep Learning AMIs
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

TensorFlow 2

本教程介绍如何在运行带 Conda 的深度学习 AMI(Conda 上的 DLAMI)的实例上激活 TensorFlow 2 并运行 TensorFlow 2 程序。

当框架的稳定 Conda 程序包发布时,它会在 DLAMI 上进行测试并预安装。

激活 TensorFlow 2

在带 Conda 的 DLAMI 上运行 TensorFlow
  1. 要激活 TensorFlow 2,请打开带 Conda 的 DLAMI 的 Amazon Elastic Compute Cloud (Amazon EC2) 实例。

  2. 对于具有 CUDA 10.1 和 MKL-DNN 的 Python 3 上的 TensorFlow 2 和 Keras 2,运行以下命令:

    $ source activate tensorflow2_p310
  3. 启动 iPython 终端:

    (tensorflow2_p310)$ ipython
  4. 运行 TensorFlow 2 程序以验证其是否正常运行:

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

    Hello, TensorFlow! 应显示在您的屏幕上。

更多教程

有关更多教程和示例,请参阅适用于 TensorFlow Python API 的 TensorFlow 文档,或访问 TensorFlow 网站。