tensorflow 'module' object has no attribut

2019-07-13 04:50发布

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

1条回答
甜甜的少女心
2楼-- · 2019-07-13 05:37

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.
查看更多
登录 后发表回答