2016-11-27 5 views
1

최근에 CIFAR 튜토리얼에서 tensorflow를 설치하고 파이썬 가져 오기 오류가 발생했습니다.
저는 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를 가져올 수 있습니다?

+0

세부 코드를 좀 알려주시겠습니까? 한 줄로 무엇이 일어나는지 알 수 없습니다. – daoliker

+0

내 코드가 여기에 있습니다. https://github.com/tensorflow/tensorflow/blob/r0.11/tensorflow/models/image/cifar10/cifar10_train.py – hamzzi

답변

0

master branch of cifar10_train.py과 TensorFlow (0.11 이하)가 이전 버전으로 설치되어있는 것처럼 보입니다. master 분기는 recently modified이었으며 TensorFlow 0.11 또는 이전 버전에서는 사용할 수 없었던 새 API를 사용했습니다.

이 문제를 해결하는 방법에는 두 가지가 있습니다. TensorFlow를 버전 0.12 이상으로 업그레이드하거나 the r0.11 branch of the TensorFlow source을 확인하고 the version of cifar10_train.py from that branch을 사용하십시오.

+0

도움 주셔서 감사합니다. 'v0.11.0rc2' 태그에서'cihar10_train.py'를 실행할 수 있습니다. – hamzzi