2

I have installed tensorflow-gpu using pip (within Anaconda). Here is the verification:

$ pip list | grep tensorflow tensorflow-gpu (1.4.0)

But whenever I run a model, it uses the CPU. Can someone please help.

Another command I tried:

$ find . -name tensorflow ./anaconda3/lib/python3.6/site-packages/tensorflow ./anaconda3/lib/python3.6/site-packages/tensorflow/include/tensorflow

Is there a conflict?

3
  • why is there a "-1" next to the post? Commented Feb 3, 2018 at 4:07
  • 2
    Possible duplicate of Tensorflow not running on GPU Commented Feb 4, 2018 at 11:24
  • 1
    Faced the similar issue. My situation was tensorflow-gpu was installed using conda, while pip installed tensorflow cpu version. I re-installed tensorflow-gpu using pip fixed the issue. Commented May 29, 2018 at 11:49

1 Answer 1

4

Assuming you are using a Nvidia-gpu have you installed cuda and cudnn before installing Tensorflow with gpu support? check this link. Moreover use pip or pip3 to install tensorflow because Anaconda will not have the latest version of tensorflow.

also try running the following in a python or a ipython shell

import tensorflow as tf
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))

You will get a sample output and if you see your GPU device in the message then tensorflow is using your gpu

Sign up to request clarification or add additional context in comments.

2 Comments

I tried the same, and I can see my gpu in the list. I have an MSI. using my Dragon centre, which shows the stats and metrics of my hardware in function, I can see that my GPU is not being used, but rather, all of my RAM is being used. Is it something that cannot be picked by the metrics? Also, when I am running my games, I can see that the GPU is being used.
@LakshmiNarayanan Do you have a nvidia GPU or a AMD?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.