简体   繁体   English

将GPU与Keras结合使用

[英]Using GPU with Keras

i'm actally facing a probleme since last friday and didn't find a solution for the moment. 自上周五以来,我实际上正面临一个问题,并且暂时未找到解决方案。

First of all, you need to know that i'm a beginner on linux,i'm trying to do some deep learning in my internship, and i discovered that even if my company have a 1080 Ti, keras wasn't using it, so have the job to correct this. 首先,您需要知道我是linux的初学者,我想在实习中做一些深度学习,我发现即使我的公司有1080 Ti,keras也没有使用它,所以有工作来纠正这个问题。

I am trying to use Keras with GPU. 我正在尝试将Keras与GPU配合使用。 I installer Tensorflow by following these steps : https://www.tensorflow.org/install/install_linux I also installer CUDA,cuDNN. 我按照以下步骤安装Tensorflow: https ://www.tensorflow.org/install/install_linux我也安装CUDA,cuDNN。

I found on my machine an older installation of CUDA (version 7.5). 我在计算机上发现较旧的CUDA安装(版本7.5)。 I installed version 9.2 without uninstalling version 7.5. 我安装了9.2版,但未卸载7.5版。 I added the PATH variables but it seems like it is not taking in account : [][ https://i.stack.imgur.com/B3Pqm.png] 我添加了PATH变量,但似乎没有考虑到:[] [ https://i.stack.imgur.com/B3Pqm.png]

I tried to uninstall CUDA version 7.5 but i don't know how to do it, since in the usr/local folder, there is no cuda-7.5 folder. 我尝试卸载CUDA 7.5版,但我不知道该怎么做,因为在usr / local文件夹中没有cuda-7.5文件夹。

When i enter nvidia-smi in the prompt, it works correctly. 当我在提示中输入nvidia-smi时,它可以正常工作。 I installed tensorflow and tensorflow-gpu, but i does not work : [][ https://i.stack.imgur.com/78gPd.png] 我安装了tensorflow和tensorflow-gpu,但是我不起作用:[] [ https://i.stack.imgur.com/78gPd.png]

Did anyone know how to help me? 有人知道如何帮助我吗? i Guess the solution of my probleme is not really complicated for someone who knows Ubuntu, and i feel like i'm loosing a lot of times doing something i don't really understand. 我猜我的问题的解决方案对于了解Ubuntu的人来说并没有那么复杂,我觉得我失去了很多时间去做一些我不太了解的事情。

If someone need some further informations in order to help me, feel free to ask. 如果有人需要更多信息以帮助我,请随时提问。

Thank you 谢谢

Uninstall tensorflow and install only tensorflow-gpu. 卸载tensorflow并仅安装tensorflow-gpu。 You should not install both. 您不应同时安装两者。 If you are using keras, then install keras-gpu. 如果使用的是keras,请安装keras-gpu。

Let's say you are working with conda and you want to tidy up all this. 假设您正在使用conda,并且想要整理所有这些内容。 Do

conda remove keras
conda remove tensorflow*
conda install keras-gpu

If you are not, then i highly recommend Anaconda for dealing with these issues which you seem to be having stress-free. 如果您不是,那么我强烈建议Anaconda处理这些似乎没有压力的问题。

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

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