TensorFlow MNIST示例错误 - 我应该更新吗?



我是Tensorflow的新手。我的版本是0.10.0。

在其上运行代码时https://github.com/tensorflow/tensorflow/blob/r1.1/tensorflow/examples/tutorials/layers/cnn_mnist.py

我有以下错误:

文件"mnist_tf_example.py",第 163 行,在 tf.app.run((
文件 "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", 第 30 行,运行中 sys.exit(main(sys.argv((
文件 "mnist_tf_example.py",第 137 行,在主 logging_hook = tf.train.LoggingTensorHook( AttributeError: 'module' 对象没有属性 'LoggingTensorHook'

我应该更新Tensorflow吗? 我安装的版本是Tensorflow网站上的版本。

我怀疑您的安装已损坏。

当前的 TensorFlow 版本,包括您在 https://www.tensorflow.org/install/install_linux 中指向的版本是 1.1.0,似乎您正在使用相应发布分支 (r1.1( 中的 MNIST 示例

但是,您提到您的TensorFlow版本是0.10.0。

您可能需要卸载/重新安装并使用以下内容验证您的版本是否正确:

import tensorflow as tf
print tf.__version__

并确保它是 1.1.0 或更高版本。

希望对您有所帮助!

最新更新