Skip to content

Instantly share code, notes, and snippets.

@LujunWeng
Forked from jovianlin/get_available_gpus.py
Last active July 20, 2017 00:53
Show Gist options
  • Save LujunWeng/47c45c11676f09cf8785802346073600 to your computer and use it in GitHub Desktop.
Save LujunWeng/47c45c11676f09cf8785802346073600 to your computer and use it in GitHub Desktop.
Get List of Devices in TensorFlow
from tensorflow.python.client import device_lib
def get_available_device():
local_device_protos = device_lib.list_local_devices()
return local_device_protos
print(get_available_device())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment