Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Keras with gpu support?

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.

like image 200
Sai Krishnadas Avatar asked Feb 14 '19 11:02

Sai Krishnadas


People also ask

Can Keras run on GPU?

keras models will transparently run on a single GPU with no code changes required.

How can I tell if Keras is using my GPU?

Checking Your GPU Availability With Keras The easiest way to check if you have access to GPUs is to call tf. config. experimental. list_physical_devices('GPU').

Does Keras run seamlessly on GPU and CPU?

Via TensorFlow (or Theano, or CNTK), Keras is able to run seamlessly on both CPUs and GPUs. When running on CPU, TensorFlow is itself wrapping a low-level library for tensor operations, called Eigen.


1 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).

like image 178
Gus Long Avatar answered Oct 10 '22 19:10

Gus Long