[Solved] tensorflow ‘module’ object has no attribute ‘contrib’

I installed tensorflow(on python 2.7,debian linux) using the pip method as shown in official documentation:
https://www.tensorflow.org/versions/r0.9/get_started/os_setup.html#pip-installation

Tested succesfully the installation as indicated by the installation ,but when doing the tutorial :
https://www.tensorflow.org/versions/r0.9/tutorials/tflearn/index.html#construct-a-deep-neural-network-classifier

After importing tensorflow correctly , when trying the line:

training_set = tf.contrib.learn.datasets.base.load_csv(filename=IRIS_TRAINING, target_dtype=np.int)

Im getting the error :
tensorflow ‘module’ object has no attribute ‘contrib’

Does anybody knows that can be wrong?

Thank you

Solution #1:

Problem solved, turns i had 2 tensorflow versions installed:

  1. When launching $python , it used 0.6 version(which didnt had contrib module)
  2. When launching $sudo python ,it had the latest 0.9 version and everything works as the documentation.
Respondent: Luis Leal

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.