conda install keras overwrites tensorflow-gpu with tensorflow (non-gpu package)

0 views
Skip to first unread message

Raul Diaz

unread,
May 11, 2018, 4:35:31 PM5/11/18
to conda - Public
Hello everyone. I wanted share a problem I encountered and the solution I found that works.

For reference, this is my environment:
Ubuntu 16.04
nVidia GPU
conda 4.5.2

I created a conda virtual environment and installed tensorflow-gpu (which resulted in 1.7.0 being installed which is not the latest, but is fine for my purposes).

I then did
conda install keras

keras was installed correctly, BUT it also installed tensorflow non-gpu version, which I cannot use.

This seems like a dependency bug in which keras package does not recognize tensorflow-gpu package as installed.

I was forced to remove tensorflow (non-gpu package) and to use

python3.6 -m pip install keras

This worked, but I would rather have consistent conda managed packages.

I hope that Anaconda fixes this, but in the meantime, you can try my solution.

Kale Franz

unread,
May 11, 2018, 4:50:01 PM5/11/18
to Raul Diaz, conda - Public
There’s a keras-gpu package just for this reason that has you covered!

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/conda/09eba2bf-dd1c-4df0-aa3f-095b08ff5f4c%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Jonathan Helmus

unread,
May 11, 2018, 5:05:31 PM5/11/18
to co...@continuum.io

Another option if you want Keras with a GPU accelerated Tensorflow is to install the "keras-gpu" conda package.

Cheers,

    - Jonathan Helmus

Raul Diaz

unread,
May 11, 2018, 5:14:31 PM5/11/18
to conda - Public
Hello Kale Franz and also Jonthan Helmus:

Thank you both for the suggestion to conda install keras-gpu.

I uninstalled the python pip installed keras and did as you suggested. It worked great! 

Thank you!.

Raul Diaz

unread,
May 11, 2018, 11:08:01 PM5/11/18
to conda - Public
After my reply that everything was working, I found a hidden problem. No matter what i did to remove the non-gpu tensorflow, it just wouldn't be removed. I tried conda remove tensorflow, and then conda clean -a but that didn't work. Finally, I had to completely uninstall anaconda, reinstall it and then recreate my virtual environment.


On Friday, May 11, 2018 at 1:35:31 PM UTC-7, Raul Diaz wrote:
Reply all
Reply to author
Forward
0 new messages