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.

GPU device not found in Colab (likely due to most recent TF 2.0 update)

See original GitHub issue

My code worked well with GPU in Colab yesterday. But this morning it became very slow. So I suspect that CPU is used despite hardware accelerator is set to GPU in “change runtime type” explicitly. The following test code result in “SystemError: GPU device not found”.

code chunk:

%tensorflow_version 2.x  
import tensorflow as tf  
device_name = tf.test.gpu_device_name()  
if device_name != '/device:GPU:0':
   raise SystemError('GPU device not found')
print('Found GPU at: {}'.format(device_name))

the same problem has be replicated by other users when I reported the issue to TF team: https://github.com/tensorflow/tensorflow/issues/34385. I posted it here because I think Colab can solve the problem by simply reverse the most recent update to TF 2.0 in their end. thank you.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
jakevdpcommented, Nov 20, 2019

If you are using tensorflow 2.0 on Colab, we recommend using the bundled version, which you can enable with:

%tensorflow_version 2.x

This will switch your tensorflow version to the current 2.X version built for Colab (see https://colab.research.google.com/notebooks/tensorflow_version.ipynb for details)

If you install external releases of tensorflow via pip install tensorflow-gpu==2.0 or similar, it will install a pre-built binary that may not be compatible with the GPUs and drivers available in Colab’s runtime.

0reactions
DevashishXcommented, May 5, 2020

Is this issue solved now ?

is 2.2.0-rc3 the right version ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Google Colab -- GPU Device not found error
:/ so far tried pip install tf-nightly-gpu and %tensorflow_version 2.x as it suggests after putting it @ the top -- still not registering...
Read more >
Tensorfow 2.2.0 on google colab - General Discussion
I would like to train the model using Google Colab, but when I install TFv2.2.0 on colab, it doesn't find the GPU. If...
Read more >
TensorFlow with GPU - Colaboratory - Google Colab
Navigate to Edit→Notebook Settings; select GPU from the Hardware Accelerator drop-down. Next, we'll confirm that we can connect to the GPU with tensorflow:....
Read more >
Intro to Google Colab - The Materials Project Workshop
Colab is a hosted python notebook service, based on Jupyter, ... for i in range(10): print(i**2). Colab ... n\n') raise SystemError('GPU device not...
Read more >
Training a model for custom object detection (TF 2.x) on ...
Run !pip list|grep opencv to see the versions of OpenCV packages installed i.e. opencv-python , opencv-contrib-python & opencv-python-headless . The versions ...
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