Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

fix gpu detection #255

Merged
merged 1 commit into from
Jan 3, 2020
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
3 changes: 2 additions & 1 deletion keras/backend/mxnet_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from numbers import Number
from functools import wraps
from collections import defaultdict
from mxnet import MXNetError

from .common import floatx, epsilon, image_data_format

Expand Down Expand Up @@ -5241,7 +5242,7 @@ def _get_mxnet_context(context):
# GPU device. If not GPUs are detected, then it falls back to CPU.
try:
gpus = mx.test_utils.list_gpus()
except CalledProcessError:
except (CalledProcessError, MXNetError):
gpus = []
if gpus and len(gpus) > 0:
mxnet_context.append(mx.gpu(gpus[0]))
Expand Down