ModuleNotFoundError:没有名为“tensorflow.examples"的模块 [英] ModuleNotFoundError: No module named 'tensorflow.examples'

查看:274
本文介绍了ModuleNotFoundError:没有名为“tensorflow.examples"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我导入 tensorflow 时

When I import tensorflow

import tensorflow as tf

我没有收到错误消息.但是,我确实收到以下错误.如果有帮助,我正在使用 spyder.

I don't get an error. However, I do get the error below. I'm using spyder if that helps.

根据其他问题,我确保使用 conda 和 pip 安装是最新的 (v1.8) tensorflow.这并没有解决问题.请协助.

As per other questions, I ensured up to date (v1.8) tensorflow using both conda and then pip installs. This didn't resolve the issue. Please assist.

import tensorflow.examples.tutorials.mnist.input_data as input_data

ModuleNotFoundError: No module named 'tensorflow.examples'

推荐答案

有时在下载 TF 时,示例目录可能不可用.您可以通过将 GitHub 存储库中的示例"目录链接到 tensorflow python wheel 文件夹来纠正它.这样您就无需更改代码.

Sometimes on downloading the TF, the example directory might not be available. You could rectify it by linking the 'example' directory from the GitHub repo into the tensorflow python wheel folder. That way you don't need to change the code.

如果这不起作用,请尝试将 import tensorflow.examples.tutorials.mnist.input_data as input_data 替换为链接中提到的 import input_data:TensorFlow MNIST 示例未与 full_connected_feed.py 一起运行

If this doesn't work, try to replace import tensorflow.examples.tutorials.mnist.input_data as input_data as import input_data as mentioned in the link: TensorFlow MNIST example not running with fully_connected_feed.py

希望这有帮助!!!

这篇关于ModuleNotFoundError:没有名为“tensorflow.examples"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆