简体   繁体   English

在ubuntu 14.04下使用sporder中的tensorflow / cuda GPU安装

[英]Use GPU installation of tensorflow/cuda in spyder under ubuntu 14.04

I am running ubuntu 14.04 with an anaconda2 installation and would like to use tensorflow in combination with CUDA. 我正在使用anaconda2安装运行ubuntu 14.04,并希望将tensorflow与CUDA结合使用。 So far the steps I performed are: 到目前为止,我执行的步骤是:

  1. Installed CUDA 7.5 and cudnn 安装了CUDA 7.5和cudnn
  2. Installed tensorflow (GPU version) through a DEB package. 通过DEB包安装tensorflow(GPU版本)。 Note that I don't want to use the conda package of tensorflow since that one is not the GPU version. 请注意,我不想使用tensorflow的conda包,因为那个不是GPU版本。
  3. Added Anaconda, CUDA and cudnn to path. 添加了Anaconda,CUDA和cudnn到路径。
  4. Created a conda environment for tensorflow (conda create -n tensorflow python=2.7) 为tensorflow创建了一个conda环境(conda create -n tensorflow python = 2.7)

Now if I start python or IDLE from the terminal, I can import tensorflow and it will find all the CUDA dependencies, great! 现在,如果我从终端启动python或IDLE,我可以导入tensorflow,它会找到所有CUDA依赖项,太棒了!

...however, if I start ipython or spyder from the same terminal, running "import tensorflow as tf" gives me a cold-hearted "ImportError: No module named tensorflow". ...但是,如果我从同一个终端启动ipython或spyder,运行“import tensorflow as tf”会让我感到冷漠“ImportError:没有名为tensorflow的模块”。

My question: How can I get ipython and spyder to find the tensorflow library just like in an IDLE and a python instance? 我的问题:我怎样才能让ipython和spyder像IDLE和python实例一样找到tensorflow库?

To solve your issue you have 3 options here: 要解决您的问题,您有3个选项:

1 just start spyder from terminal 1从终端开始spyder

2 move PATH variable definition from .bash_profile to session init scripts 2将PATH变量定义从.bash_profile移动到会话初始化脚本

3 Duplicate your PATH in spyder's run configuration 3在spyder的运行配置中复制PATH

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM