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.

Spyder doesn't recognize TensorFlow GPU

See original GitHub issue

Hello.

So I spent a good amount of time installing and tuning TensorFlow GPU version.

And through Anaconda prompt it works perfectly.

I run this piece of code to check if I can use GPU:

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

And it gives me the result:

[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 11171278383842874612
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 3238717030
locality {
  bus_id: 1
}
incarnation: 17164589319225185596
physical_device_desc: "device: 0, name: GeForce GTX 960M, pci bus id: 0000:01:00.0, compute capability: 5.0"
]

However if I run it in Spyder I’m getting that I can only use my CPU:

[name: "/cpu:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 18858102688050260
]

I tried to open Spyder through the environment, since it’s the only suggestion I could find on the Internet. Like

activate tensorflow
spyder 

But still it shows I can use only CPU. I also tried to update the spyder… still no luck. Spyder refuses to see that I can use GPU. What the trick can be? How can I make Spyder see the GPU

Version and main components

  • Spyder Version: 3.2.6
  • Python Version: 3.6.1
  • Qt Versions: 5.6.2, PyQt5 5.6 on Windows

Dependencies

pyflakes >=0.6.0 :  1.5.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.1 (OK)
numpy >=1.7      :  1.12.1 (OK)
sphinx >=0.6.6   :  1.5.6 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.1.1 (OK)
sympy >=0.7.3    :  1.0 (OK)
cython >=0.21    :  0.25.2 (OK)
qtconsole >=4.2.0:  4.3.0 (OK)
IPython >=4.0    :  5.3.0 (OK)
pylint >=0.25    :  1.6.4 (OK)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alenashilinacommented, Feb 19, 2018

I have just reinstalled everything from the scratch (starting with anaconda). Then spyder refused to see firstly tensorflow, then keras, then pillow… Then I reinstall those several times, and opened spyder under tensorflow environment… Somehow it works now.

0reactions
Ehteshamciitwahcommented, Jul 16, 2021

Hello, I installed tensorflow gpu 2.5 and it will automatically install Cuda and cudnn. I install jupyter and check the config devices and it is showing both CPU and GPU. But when I want to try on spyder. spyder is not detecting GPU. Is there any problem of TensorFlow 2.5 with spyder. Need Suggestion. Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

can not import TensorFlow in Spyder or Python ...
2 Answers 2 · Run the anaconda prompt as administrator.(right click-> run as administrator). · pip uninstall tensorflow. · Close anaconda prompt.
Read more >
Found conflicts when installing Spyder in an environment with ...
I'm experiencing dependence conflicts when trying to install spyder in an environment that includes package tensorflow-gpu release 2.5 from ...
Read more >
How do you get TensorFlow into Anaconda Spyder? - Quora
No, Anaconda does not have Tensorflow installed by default. But you can install it manually. One way would be using the shell command...
Read more >
Installing Python and Tensorflow with Jupyter Notebook ...
Tensorflow is of two kinds : CPU and GPU version. This post only deal with CPU version since my laptop does not have...
Read more >
217 - 9 steps to installing TensorFlow GPU on Windows 10
I installed Spyder 4.1.5 via Anaconda individual edition. ... But on Windows you will not be able to efficiently use both GPUs for...
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