Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AttributeError: module 'tensorflow_core._api.v2.config' has no attribute 'list_physical_devices'

Am using Tensorflow 2.0 on Ubuntu 18.04. On running

tf.config.list_physical_devices('GPU')

I get the above error. What is the workaround for this?

like image 532
Malgo Avatar asked Dec 10 '19 11:12

Malgo


1 Answers

Run tf.config.experimental.list_physical_devices('GPU') to see all the GPUs

or

run tf.config.experimental.list_physical_devices(device_type=None) to see all the devices

You can also use tf.test.is_gpu_available(). It says True if it detects the available gpu.

like image 94
Malgo Avatar answered Oct 28 '22 07:10

Malgo