TensorFlow:“模块"对象没有“SessionRunHook"属性 [英] TensorFlow: 'module' object has no attribute 'SessionRunHook'
问题描述
我在 Ubuntu 16.04 上运行 TensorFlow 版本 r0.10.我已经能够运行一些基本教程,包括 MIST 字符识别教程.
I'm running TensorFlow version r0.10 on Ubuntu 16.04. I have been able to run some basic tutorials, including the MIST character recognition tutorial.
我正在尝试完成CIFAR-10 来自 TensorFlow 的教程示例,使用 tensorflow 版本 r0.10.
I'm trying to complete the CIFAR-10 tutorial example from TensorFlow, on tensorflow version r0.10.
当我执行 cifar10_train.py
之后:在开始训练之前用 20000 张 CIFAR 图像填充队列.这将需要几分钟.
脚本失败:
文件cifar10_train.py",第 85 行,火车中类_LoggerHook(tf.train.SessionRunHook):AttributeError: 'module' 对象没有属性 'SessionRunHook'
请有人帮我找到这个错误的解决方案吗?
Please could someone help me find the solution to this error?
谢谢
推荐答案
您尝试运行的代码来自比您安装的版本更高的 TensorFlow 存储库版本:
The code you are trying to run is from a later version of the TensorFlow repository than the version you have installed:
- 使用
tf.train.SessionRunHook
的代码被添加到2016 年 11 月 23 日的主分支,是 r0.12 版本的一部分. tf.train.SessionRunHook
类本身是 创建于 2016 年 10 月 3 日,并在 r0.12 中首次成为正式版本的一部分.
- The code that uses
tf.train.SessionRunHook
was added to the master branch on November 23rd, 2016, and is part of the r0.12 release. - The
tf.train.SessionRunHook
class itself was created on October 3rd, 2016, and first became part of an official release in r0.12.
TensorFlow 教程代码仅适用于该库的当代版本.要使用 r0.10 运行 CIFAR-10 教程,您应该克隆 GitHub 存储库的 r0.10
分支:
TensorFlow tutorial code only works with the contemporary version of the library. To run the CIFAR-10 tutorial using r0.10, you should clone the r0.10
branch of the GitHub repository:
$ git clone -b r0.10 https://github.com/tensorflow/tensorflow.git
这篇关于TensorFlow:“模块"对象没有“SessionRunHook"属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!