Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
#14199: catch subprocess.CalledProcessError in get_gpus()
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu committed Feb 20, 2019
1 parent f9c436b commit ceb5c25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/image-classification/common/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ def get_gpus():
"""
try:
re = subprocess.check_output(["nvidia-smi", "-L"], universal_newlines=True)
except OSError:
except (subprocess.CalledProcessError, OSError):
return []
return range(len([i for i in re.split('\n') if 'GPU' in i]))

0 comments on commit ceb5c25

Please sign in to comment.