question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installing keras makes tensorflow can't find GPU

See original GitHub issue

I have used keras + tensorflow-gpu in my old computer, it’s very ok. (I forget the tensorflow version)

I install keras with tensorflow-gpu (version 1.0.1) in my new computer, and before install keras, tensorflow can find my GPU. But after install keras, tensorflow only can find CPU. (use $ pip3 install keras)

I use these code to check GPU:

from tensorflow.python.client import device_lib
device_lib.list_local_devices() 
$ nvidia-smi

And I tried to install keras from source ($ python setup.py install), it would have some error and install fail.

...
Installed /home/thisray/keras-test/lib/python3.5/site-packages/Keras-2.0.0-py3.5.egg
Processing dependencies for Keras==2.0.0
Searching for tensorflow
Reading https://pypi.python.org/simple/tensorflow/
No local packages or working download links found for tensorflow
error: Could not find suitable distribution for Requirement.parse('tensorflow')

Is this problem about version ?

thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

24reactions
thisraycommented, Mar 15, 2017

Thanks for your explanation. After: install tensorflow -> install keras -> uninstall tensorflow -> install tensorflow and it works! Thanks a lot!

16reactions
ghostcommented, Mar 15, 2017

Yeah, currently when you install Keras using pip or pip3 it blows off existing TF and installs the default, non-GPU version. It’d be great if there was a flag to not touch existing TF.

The workaround is to uninstall TF after installing Keras, and then installing the GPU version using pip or pip3 depending on your preferred python version. Not very elegant, but you gotta do what you gotta do.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keras tensorflow backend does not detect GPU - Stack Overflow
I was able to solve the issue by installing tensorflow again with pip install tensorflow-gpu . From keras GitHub issue: github.com/fchollet/ ...
Read more >
Solution to TensorFlow 2 not using GPU - Medium
Making TensorFlow 2 code or Keras code run on GPU. This article addresses the reason and debugging/solution process to solve the issue of ......
Read more >
How to Install TensorFlow and Keras with GPU support on ...
In this post, you will learn how to install TensorFlow and Keras with GPU support on windows. We will go through step by...
Read more >
How to correctly install Keras and Tensorflow - ActiveState
Click to install Keras and Tensorflow together using pip. ... To install TensorFlow for CPU and GPU processors, run the following command:
Read more >
How to Install the Latest TensorFlow Keras with a GPU without ...
In this video, I show how to install the latest version of TensorFlow with full GPU support. Though CONDA allows this install with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found