I installed Tensorflow for GPU using: pip install tensorflow-gpu
But when I tried the same for Keras pip install keras-gpu
, it pulled me an error: could not find the version that satisfies the requirements.

- 15,395
- 32
- 113
- 196

- 2,863
- 9
- 36
- 69
-
1Please state the version of Python used. Also note, keras-gpu is a conda install, not pip install. – Prabindh May 11 '19 at 08:59
4 Answers
Adding to the answer below which is the correct answer in terms of recommending to use Anaconda package manager, but out of date in that there is now a keras-gpu package on Anaconda Cloud.
So once you have Anaconda installed, you simply need to create a new environment where you want to install keras-gpu and execute the command:
conda install -c anaconda keras-gpu
This will install Keras along with both tensorflow and tensorflow-gpu libraries as the backend. (There is also no need to install separately the CUDA runtime and cudnn libraries as they are also included in the package - tested on Windows 10 and working).

- 57,590
- 26
- 140
- 166

- 451
- 5
- 9
-
In that case, `keras` is using `tensorflow` CPU version as backend and not using GPU at all. Any idea how to fix this? – Nagabhushan S N Oct 08 '21 at 06:20
-
Installing tensorflow-gpu first and then installing keras-gpu worked! https://stackoverflow.com/a/69498829/3337089 – Nagabhushan S N Oct 08 '21 at 16:13
There is not any keras-gpu
package [UPDATE: now there is, see other answer above]; Keras is a wrapper around some backends, including Tensorflow, and these backends may come in different versions, such as tensorflow
and tensorflow-gpu
. But this does not hold for Keras itself, which should be installed simply with
pip install keras
independently of whatever backend is used (see the PyPi docs).
Additionally, and since you have tagged the question as anaconda
, too, be informed that it is generally not advisable to mix your package managers (i.e pip
with conda
), and you may be better off installing Keras from the Anaconda cloud with
conda install -c conda-forge keras
Finally, you may be also interested to know that recent versions of Tensorflow include Keras as a subpackage, so you can use it without any additional installation; see https://www.tensorflow.org/guide/keras
For installing tensorflow-gpu
from Anaconda cloud, you should use
conda install -c anaconda tensorflow-gpu
before installing Keras. Be sure you do it in a different virtual environment, or after having uninstalled other versions (i.e. pip
-installed ones), as there have been reported problems otherwise.

- 57,590
- 26
- 140
- 166
-
so instead pip install tensorflow-gpu .. What can i use to install in a anaconda – Sai Krishnadas Feb 14 '19 at 11:38
-
@SaiKrishnadas see updated answer (it was a simple Google search, in any case...); and if the answer has been helpful, kindly accept it - thanks – desertnaut Feb 14 '19 at 11:55
-
Still.. **System information** * **Windows 7** * **pip install tensorflow-gpu** * Python version: **3.6.6** * Installed using virtualenv? pip? conda?: **pip** * CUDA/cuDNN version: **CUDA 8.0 cuDNN 7.1** * GPU model and memory: **Model : Quadro 4000 , Memory : 18GB** Installed using pip install tensorflow-gpu (No error, perfectly installed) While importing tensorflow , i got a error : **Failed to load native tensorflow .ImportError: DLL load failed: The specified module could not be found** – Sai Krishnadas Feb 14 '19 at 12:37
-
Your initial question was about `keras-gpu`, which has been addressed in the answer. If you have a **different** issue with a different package, you are very welcome to open a new question, after accepting this one. – desertnaut Feb 14 '19 at 12:56
Adding to the above two answers, ensure your TensorFlow/Keras environment is using Python 3.6. Keras/TensorFlow doesn't work very well with Python 3.7, as of May 10, 2019.
I tried to use Keras/TensorFlow with Python 3.7 and I ended up having to reinstall Anaconda, since it sort of broke my Anaconda Prompt.

- 4,838
- 8
- 39
- 61
To install tensorflow-gpu with particular cuda version 9.0, use:
conda install tensorflow-gpu cudatoolkit==9.0 -c anaconda
Similarly for keras-gpu

- 57,590
- 26
- 140
- 166

- 145
- 1
- 8
-
this can cause conflicts with other newer cuda packages like pycuda – lefunction Apr 30 '22 at 16:58
-
You shouldn't be having a problem if those packages are in different conda environments – alercelik Nov 30 '22 at 08:51