Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't use GPU on Google Colab for tensorflow 2.0

I am trying to run my notebook using a GPU on Google Colab, but it doesn't provide me a GPU, however when I run the notebook with tensorflow 1.15.0, the GPU is available.

tf.test.gpu_device_name()

gives the output '/device:GPU:0' for tensorflow 1.15.0

But when I do the same with tensorflow 2.0.0 the function returns ''.

like image 758
Alwin Aind Avatar asked Dec 10 '22 01:12

Alwin Aind


1 Answers

I solved installing in google colab

!pip install tensorflow-gpu 

and

!pip install tf-nightly 

So now tf.test.gpu_device_name(), the output is /device:GPU:0 But, TensorFlow automatically upgrade its version to 2.1.0-dev20191120

like image 187
Cristina Bustos Avatar answered Dec 31 '22 03:12

Cristina Bustos