tensorflow'模块'对象没有属性'contrib' [英] tensorflow 'module' object has no attribute 'contrib'

查看:1299
本文介绍了tensorflow'模块'对象没有属性'contrib'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用pip方法安装了tensorflow(在python 2.7,debian linux上),如官方文档中所示: https://www.tensorflow.org/versions/r0.9/get_started/os_setup.html#pip-installation

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

已按照安装指示成功测试了安装,但是在进行本教程时: https: //www.tensorflow.org/versions/r0.9/tutorials/tflearn/index.html#construct-a-deep-neural-network-classifier

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

正确导入tensorflow后,尝试以下行时:

After importing tensorflow correctly , when trying the line:

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

出现错误: tensorflow'模块'对象没有属性'contrib'

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

有人知道这可能是错误的吗?

Does anybody knows that can be wrong?

谢谢

推荐答案

问题解决了,转而我安装了2个tensorflow版本:

Problem solved, turns i had 2 tensorflow versions installed:

  1. 启动$ python时,它使用的是0.6版本(没有contrib模块)
  2. 启动$ sudo python时,它具有最新的0.9版本,所有内容均可作为文档使用.

这篇关于tensorflow'模块'对象没有属性'contrib'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆