I recently install tensorflow 2.0 on my computer but when I try to run it on my GPU, the function tf.config.experimental.list_physical_devices('GPU') on Jupyter or Vitual Studio Code it returns me a void array. Do you know why ?
My set-up :
Computer : MSI
Processor : Intel(R) Core(TM) i7-8750H CPU @ 2.220GHz
GPU 0 : Intel(R) UHD Graphics 630
GPU : NVIDIA GeForce GTX 1060
Python : Ananconda 3 with Python 3.7
Tensenflow 2.0 installed with pip install tensorflow
My test code :
physical_devices = tf.config.experimental.list_physical_devices('GPU')
print(physical_devices)
if physical_devices:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
Thanks in advance ! :)
Providing the solution here (Answer Section), even though it is present in the Comment Section for the benefit of the community.
Instead of pip install tensorflow, you can try pip3 install --upgrade tensorflow-gpu or just remove tensorflow and then installing "tensorflow-gpu will resolves your issue.
After installation of Tensorflow GPU, you can check GPU as below
physical_devices = tf.config.experimental.list_physical_devices('GPU')
print(physical_devices)
if physical_devices:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
Output:
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With