Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions keras/utils/multi_gpu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


def _get_available_devices():
return [x.name for x in K.get_session().list_devices()]
return K.tensorflow_backend._get_available_gpus()


def _normalize_device_name(name):
Expand Down Expand Up @@ -153,7 +153,7 @@ def multi_gpu_model(model, gpus=None, cpu_merge=True, cpu_relocation=False):
if not gpus:
# Using all visible GPUs when not specifying `gpus`
# e.g. CUDA_VISIBLE_DEVICES=0,2 python keras_mgpu.py
gpus = len([x for x in available_devices if 'gpu' in x])
gpus = len(available_devices)

if isinstance(gpus, (list, tuple)):
if len(gpus) <= 1:
Expand Down