我使用pip方法安装了tensorflow(在python 2.7,debian linux上),如官方文档所示: 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
正确导入tensorflow后,尝试该行时:
training_set = tf.contrib.learn.datasets.base.load_csv(filename=IRIS_TRAINING, target_dtype=np.int)
我收到错误: tensorflow “模块”对象没有属性“contrib”
有人知道这可能是错误的吗?
谢谢
最佳答案
问题解决了,我安装了 2 个 Tensorflow 版本:
- 启动 $python 时,使用的是 0.6 版本(没有 contrib 模块)
- 启动 $sudo python 时,它有最新的 0.9 版本,一切都如文档所示。
关于python - tensorflow 'module' 对象没有属性 'contrib',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38238192/