Last active
June 7, 2018 03:03
-
-
Save serinth/320d495a9177ba7d18ebf5c2758c3224 to your computer and use it in GitHub Desktop.
Tests tensorflow-gpu installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment