import Tensorflow工作但不导入任何东西

时间:2016-12-18 16:32:47

标签: python tensorflow

我按照此页面的安装进行了操作: https://alliseesolutions.wordpress.com/2016/09/08/install-gpu-tensorflow-from-sources-w-ubuntu-16-04-and-cuda-8-0-rc/

所有步骤都没有问题,事先安装了CUDA 8.0和Cudnn5.1。 (在配置TensorFlow期间无法指定5.1,所以我说5)

我没有使用anaconda或虚拟环境。

这是我得到的:

我指向python3.5,所以我在命令行中启动python3,导入tensorflow作为tf,尝试从网页(或在tensorflow网站上运行示例:https://www.tensorflow.org/versions/master/get_started/os_setup#test_the_tensorflow_installation),我得到错误等如: AttributeError: module 'tensorflow' has no attribute 'InteractiveSession' AttributeError: module 'tensorflow' has no attribute 'constant'

我的猜测是找不到tensorflow的任何子模块,当我做dir(tf)时,我得到: [' doc ',' loader ','名称','','路径','规范'] 我猜的是比它应该的少。

这与tensorflow的github问题非常相似:https://github.com/tensorflow/tensorflow/issues/3369

但它没有帮助我。 我删除了tensorflow文件夹并重新安装了几次,我没有尝试重新安装CUDA因为我不认为问题来自那里。

有什么想法?

1 个答案:

答案 0 :(得分:1)

在初始教程,Tensorflow安装页面和其他教程http://withr.me/install-tensorflow-ubuntu-16-04/之间,我设法使用Python 3.5安装Tensorflow。

不幸的是,我不清楚我是如何做到的,我只是从这三个部分中获取了部分内容。