Python 无法通过Anaconda上的Tensorflow获取MNIST数据集
我试图通过Tensorflow获得MNIST数据集,如下所示Python 无法通过Anaconda上的Tensorflow获取MNIST数据集,python,tensorflow,machine-learning,mnist,Python,Tensorflow,Machine Learning,Mnist,我试图通过Tensorflow获得MNIST数据集,如下所示 from tensorflow.examples.tutorials.mnist import input_data data = input_data.read_data_sets("data/MNIST/", one_hot=True) 作为标题,我在Anaconda(Linux)上安装了Tensorflow,包的版本是Tensorflow 1.8.0 (参考:) 但以下是错误消息: from tensorflow.exampl
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets("data/MNIST/", one_hot=True)
作为标题,我在Anaconda(Linux)上安装了Tensorflow,包的版本是Tensorflow 1.8.0
(参考:)
但以下是错误消息:
from tensorflow.examples.tutorials.mnist import input_data
ModuleNotFoundError: No module named 'tensorflow.examples'; 'tensorflow' is not a package
是因为tensorflow版本太旧,无法下载MNIST吗
我还发现了相关的问题:
但这是通过sklearn下载MNIST。是否可以通过Anaconda上的tensorflow下载?上述错误的两个可能原因:
上述错误的两个可能原因:
不要将你的程序命名为“tensorflow.py”。@xdurch0明白了!同一目录中还有另一个名为“tensorflow.py”的文件。。。。谢谢不要将你的程序命名为“tensorflow.py”。@xdurch0明白了!同一目录中还有另一个名为“tensorflow.py”的文件。。。。谢谢