from tensorflow.examples.tutorials.mnist import input_data或from tensorflow_core.example.tutorials报错
from tensorflow.examples.tutorials.mnist import input_data,examples标红报错。from tensorflow_core.examples.tutorials.mnist import input_data,tutorials标红报错,终极解决办法。#报错原因一般低版本的tensorflow不会报错,高版本的tensorflow,比如
from tensorflow.examples.tutorials.mnist import input_data,examples标红报错。from tensorflow_core.examples.tutorials.mnist import input_data,tutorials标红报错,终极解决办法。
#报错原因
一般低版本的tensorflow不会报错,高版本的tensorflow,比如2.0版本就会报错。这是因为在tensorflow文件的exampls中缺乏tuorials文件。
#解决办法
在tensorflow-master 文件中找到exampls文件下的tuorials文件,将该文件添加到虚拟环境tensorflow中,就可以了。
1、下载 tensorflow-master 文件
首先提前下载 tensorflow-master 文件。百度云盘连接如下:
链接:https://pan.baidu.com/s/12mx_3gG3c3LWV9MQITfJsw
提取码:1122
下载好文件解压,找到exampls文件,路径为:
tensorflow-master\tensorflow-master\tensorflow\examples
2、from tensorflow.examples.tutorials.mnist import input_data,报错解决办法:
在创建的虚拟环境中,找到tensorflow,添加exampls文件。以我的为例,创建的虚拟环境中,tensorflow文件路径为:
D:\Python3.6\Lib\site-packages\tensorflow
注:我的虚拟环境在D:\Python3.6。每个人的虚拟环境路径不一样。
最后将上面在百度云盘里下载的文件里的examples文件,直接复制到tensorflow文件夹中。
3、from tensorflow_core.examples.tutorials.mnist import input_data,报错解决办法:
与2的解决办法类似,在虚拟环境中找到tensorflow_core文件,文件路径:
…\Python3.6\Lib\site-packages\tensorflow_core
最后将在百度云盘里下载的文件里的examples文件中的tutorials文件,直接复制到tensorflow_core文件夹中。
4、操作完以上步骤,重启pycharm,或者其他编程环境,问题就完美解决啦。
更多推荐
所有评论(0)