【问题标题】:Having error with Tensorflow MnistTensorFlow Mnist 出错
【发布时间】:2016-08-28 09:08:11
【问题描述】:

我刚刚开始使用 Tensorflow,我已经用我的 test.py 文件完成了“hello world”。继续下一步,我开始做教程(https://www.tensorflow.org/versions/master/tutorials/mnist/beginners/index.html)。 这就是我所做的

$ git clone https://github.com/tensorflow/tensorflow

并运行“fully_connected_feed.py”文件

python tensorflow/examples/tutorials/mnist/fully_connected_feed.py

我得到了类似的错误

Traceback(最近一次调用最后一次):

文件“tensorflow/examples/tutorials/mnist/fully_connected_feed.py”,

第 27 行,在

从 tensorflow.examples.tutorials.mnist 导入输入数据

ImportError: 没有名为 examples.tutorials.mnist 的模块

所以我从

更改了代码

从 tensorflow.examples.tutorials.mnist 导入输入数据

从 tensorflow.examples.tutorials.mnist 导入 mnist

导入输入数据

导入mnist

但我又遇到了错误。

Traceback(最近一次调用最后一次):

文件“tensorflow/examples/tutorials/mnist/fully_connected_feed.py”,第 27 行,在

导入输入数据 文件

“/Users/naggi/Documents/ML/tensorflow/tensorflow/examples/tutorials/mnist/input_data.py”,第 29 行,在

从 tensorflow.contrib.learn.python.learn.datasets.mnist 导入 read_data_sets

ImportError: 没有名为 contrib.learn.python.learn.datasets.mnist 的模块

有人可以帮我吗? 谢谢

【问题讨论】:

    标签: python python-2.7 tensorflow


    【解决方案1】:

    通过 pip 安装:

    $ sudo apt-get install python-pip python-dev
    
    $ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
    

    【讨论】:

    • 感谢您回答我的问题。我已经运行了下面的代码 >sudo pip install --upgrade storage.googleapis.com/tensorflow/linux/cpu/… 但我遇到了另一个错误 > tensorflow-0.8.0-cp27-none-linux_x86_64.whl 不是这个平台上支持的轮子。我已经搜索过,但我无法弄清楚是什么问题
    • @NaggiGoishi 你的平台是什么?
    • 这是为 Linux @NaggiGoishi
    • @NaggiGoishi 哪个Linux? Ubuntu?
    • @SungKim:@ NishantSingh,嗯...我正在使用 Mac OS (El Capitan)。这是在回答你的问题吗?
    【解决方案2】:
    1. 将 pip 更新到最新版本
    2. sudo easy_install --upgrade 6
    3. sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl

    适用于 Mac 操作系统

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-23
      • 1970-01-01
      • 2017-06-16
      相关资源
      最近更新 更多