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

元气小坏坏 提交于 2021-02-11 02:01:06

问题


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?


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!