最近,我安裝了tensorflow並在CIFAR教程中得到了python導入錯誤。
我使用Mac OS X,僅限CPU,Python 2.7。Tensorflow - CIFAR教程中的導入錯誤
$ python cifar10_train.py
Filling queue with 20000 CIFAR images before starting to train. This will take a few minutes.
Traceback (most recent call last):
File "cifar10_train.py", line 120, in
tf.app.run()
File "/Users/sunwoo/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "cifar10_train.py", line 116, in main
train()
File "cifar10_train.py", line 76, in train
class _LoggerHook(tf.train.SessionRunHook):
AttributeError: 'module' object has no attribute 'SessionRunHook'
如何導入tf.train.SessionRunHook?
你能給我更詳細的代碼嗎?我無法弄清楚一條線路會發生什麼。 – daoliker
我的代碼在這裏。 https://github.com/tensorflow/tensorflow/blob/r0.11/tensorflow/models/image/cifar10/cifar10_train.py – hamzzi