John
John

Reputation: 303

TensorFlow: 'module' object has no attribute 'SessionRunHook'

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.

I'm trying to complete the CIFAR-10 tutorial example from TensorFlow, on tensorflow version r0.10.

When I execute cifar10_train.py

After: Filling queue with 20000 CIFAR images before starting to train. This will take a few minutes.

The script fails with:

File "cifar10_train.py", line 85, in train class _LoggerHook(tf.train.SessionRunHook): AttributeError: 'module' object has no attribute 'SessionRunHook'

Please could someone help me find the solution to this error?

Thank you

Upvotes: 5

Views: 6031

Answers (2)

crypdick
crypdick

Reputation: 19904

I solved this problem simply by uploading Tensorflow with pip.

pip install -U tensorflow

Upvotes: 0

mrry
mrry

Reputation: 126184

The code you are trying to run is from a later version of the TensorFlow repository than the version you have installed:

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

Upvotes: 3

Related Questions