【发布时间】:2017-07-08 04:28:10
【问题描述】:
我目前在 Amazon EC2 实例上运行,并尝试在 Jupyter Notebook (Python 2.7) 中运行以下代码:
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/")
images, labels = mnist.train.images, mnist.train.labels
images = images.reshape((55000,28,28))
np.savez_compressed("MNIST_data/train", images=images, labels=labels)
但是,我收到以下错误:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-4-de596f1c663d> in <module>()
1
----> 2 from tensorflow.examples.tutorials.mnist import input_data
3 mnist = input_data.read_data_sets("MNIST_data/")
4 images, labels = mnist.train.images, mnist.train.labels
5 images = images.reshape((55000,28,28))
ImportError: No module named tensorflow.examples.tutorials.mnist
到目前为止,我还没有安装任何库来让 TensorFlow 代码工作(而且我不确定为什么我不需要安装任何东西)。如何安装此示例集?
【问题讨论】:
标签: python amazon-web-services amazon-ec2 tensorflow