简体   繁体   中英

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. So far the steps I performed are:

  1. Installed CUDA 7.5 and cudnn
  2. Installed tensorflow (GPU version) through a DEB package. Note that I don't want to use the conda package of tensorflow since that one is not the GPU version.
  3. Added Anaconda, CUDA and cudnn to path.
  4. Created a conda environment for tensorflow (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!

...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".

My question: How can I get ipython and spyder to find the tensorflow library just like in an IDLE and a python instance?

To solve your issue you have 3 options here:

1 just start spyder from terminal

2 move PATH variable definition from .bash_profile to session init scripts

3 Duplicate your PATH in spyder's run configuration

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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