Unverified Commit 1f34fcaf authored by Toby Boyd's avatar Toby Boyd Committed by GitHub
Browse files

Merge pull request #3141 from yaroslavvb/patch-1

assert fails on requesting gpus when not available
parents 5fa2a4e6 6b9d5fba
......@@ -503,6 +503,8 @@ if __name__ == '__main__':
help='Epsilon for batch norm.')
args = parser.parse_args()
if args.num_gpus > 0:
assert tf.test.is_gpu_available(), "Requested GPUs but none found."
if args.num_gpus < 0:
raise ValueError(
'Invalid GPU count: \"--num-gpus\" must be 0 or a positive integer.')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment