New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing keras makes tensorflow can't find GPU #5776

Closed
thisray opened this Issue Mar 15, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@thisray

thisray commented Mar 15, 2017

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

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost 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.

ghost commented 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.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Mar 15, 2017

Argument in favor of more sophisticated handling: some folks use TF they have compiled themselves for their native machine architecture to speed up things like on-CPU image processing. For them to be reset to default TF when they upgrade is a bit of a nuisance.

ghost commented Mar 15, 2017

Argument in favor of more sophisticated handling: some folks use TF they have compiled themselves for their native machine architecture to speed up things like on-CPU image processing. For them to be reset to default TF when they upgrade is a bit of a nuisance.

@thisray

This comment has been minimized.

Show comment
Hide comment
@thisray

thisray Mar 15, 2017

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

thisray commented Mar 15, 2017

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

@adamcavendish

This comment has been minimized.

Show comment
Hide comment
@adamcavendish

adamcavendish Mar 15, 2017

Contributor

See #5766 . Use --no-deps

Contributor

adamcavendish commented Mar 15, 2017

See #5766 . Use --no-deps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment