Skip to content

Instantly share code, notes, and snippets.

@hatamiarash7
Created January 16, 2020 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatamiarash7/9590f637fb71ab07fdc03b69e324e82f to your computer and use it in GitHub Desktop.
Save hatamiarash7/9590f637fb71ab07fdc03b69e324e82f to your computer and use it in GitHub Desktop.
Test Tensorflow GPU Availability
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_datasets as tfds
version = tf.__version__
executing_eagerly = tf.executing_eagerly()
hub_version = hub.__version__
available = tf.config.experimental.list_physical_devices("GPU")
print("Version: ", version)
print("Eager mode: ", executing_eagerly)
print("Hub Version: ", h_version)
print("GPU is", "available" if avai else "NOT AVAILABLE")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment