chevron_left
TensorFlow
check_circle
Mark as learned thumb_up
0
thumb_down
0
chat_bubble_outline
0
auto_stories new
settings
Checking if GPU is available on TensorFlow 2
Machine Learning
chevron_rightTensorFlow
schedule Jul 1, 2022
Last updated local_offer
Tags tocTable of Contents
expand_more Check out the interactive map of data science
Solution
To check if GPU is available on TensorFlow:
Here, we are first obtaining the list of available GPUs like so:
tf.config.list_physical_devices('GPU')
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
If a GPU is not available, then you will get an empty list.
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
thumb_up
thumb_down
Ask a question or leave a feedback...
thumb_up
0
thumb_down
0
chat_bubble_outline
0
settings
Enjoy our search
Hit / to insta-search docs and recipes!