Last active
August 4, 2022 23:16
-
-
Save lanzani/fc20b2ccbd741524a50cfd3d1a81416c to your computer and use it in GitHub Desktop.
Check CUDA compatibility with TensorFlow & DLIB.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_gpu_support(): | |
"""Check CUDA compatibility with TensorFlow & DLIB. | |
""" | |
import os | |
import dlib | |
import tensorflow as tf | |
print("[INFO] TensorFlow: ", tf.__version__) | |
print("[INFO] DLIB: ", dlib.__version__) | |
# os.environ['CUDA_VISIBLE_DEVICES'] = '' | |
if tf.test.gpu_device_name(): | |
print('[INFO] GPU: Found') | |
else: | |
print("[INFO] GPU: Not found") | |
print("[INFO] Testing on GPU...") | |
print("[INFO] TensorFlow GPU-Support: ", | |
"available" if tf.test.is_gpu_available() else "NOT available") | |
# tf.config.list_physical_devices('GPU') | |
print("[INFO] Dlib GPU-Support: ", | |
"available" if dlib.DLIB_USE_CUDA else "NOT available") | |
test_gpu_support() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment