Skip to content

Instantly share code, notes, and snippets.

View ig248's full-sized avatar

Igor Gotlibovych ig248

View GitHub Profile
@ig248
ig248 / get_available_gpus.py
Created November 1, 2017 23:45 — forked from jovianlin/get_available_gpus.py
Get List of Devices in TensorFlow
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
get_available_gpus()