在tensorflow2.0中运行
from tensorflow.examples.tutorials.mnist import input_data
出现报错
ImportError: No module named ‘tensorflow.examples.tutorials’
这个报错的原因是tensorflow2.0的数据集集成到keras高级接口之中
可以查看这篇文章https://blog.csdn.net/qq_43060552/article/details/103189040
对于通过下载tensorflow/examples/tutorials模块拷贝到本地使其能运行tf1.XX版本的代码要找到本地拷贝的目录。
这里以windows下anaconda3安装tensorflow2.0环境的拷贝位置为例说明,
1.进入github的tensorflow主页下载缺失的tutorials模块文件 网址为:https://github.com/tensorflow/tensorflow。
使用master分支(默认进去就是master分支)
2.tf2.0中examples在anaconda3中运行目录为