()
| 107 | |
| 108 | |
| 109 | def get_available_gpus(): |
| 110 | from tensorflow.python.client import device_lib |
| 111 | local_device_protos = device_lib.list_local_devices() |
| 112 | return [x.name for x in local_device_protos if x.device_type == 'GPU'] |
| 113 | |
| 114 | |
| 115 | if __name__ == '__main__': |