我首先开始了tensorflow,我正在为初学者阅读教程。
在窗口中,所以我使用了Oracle,并通过Setup.html#virtualenv-安装通过pip安装了
而且,我通过编译"import tensorflow by tf“来检查tensorflow运行良好,没有错误。
但是,在教程中,我在教程代码中出错了。
没有名为examples.tutorials.mnist的模块,
在"from tensorflow.examples.tutorials.mnist import input_data“。
我不知道为什么会有这样的错误..。这不是下载MNIST数据的代码吗?
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
import tensorflow as tf
x = tf.placeholder(tf.float32, [None, 784])
W = tf.Variable(tf.zeros([784,10])) # weight
b = tf.Variable(tf.zeros([10])) # bias
y = tf.nn.softmax(tf.matmul(x, W) + b)发布于 2017-01-04 19:19:17
我也有同样的问题,但我在Windows上天真地运行它( Windows的张量流于2016年11月发布)。对我来说,问题在于我试图使用错误的Python版本运行它。
除了Python2.7(用于其他工作)外,我还使用发射装置安装了Pythonv3.5用于张量流。Python 3.5在windows上运行张量流是必需的。我默认使用Python2.7,所以当我尝试运行它时,我会发现错误的python版本运行它所导致的错误。为了强制它使用Python3,我运行命令py -3 tf_tutorial.py而不是python tf_tutorial.py。
不知道这会不会对你有帮助。但希望有这个问题的人发现这是有用的。
https://stackoverflow.com/questions/39809467
复制相似问题