问题
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:
- Installed CUDA 7.5 and cudnn
- 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.
- Added Anaconda, CUDA and cudnn to path.
- 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?
回答1:
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
来源:https://stackoverflow.com/questions/37236677/use-gpu-installation-of-tensorflow-cuda-in-spyder-under-ubuntu-14-04