Test: Python Tensorflow GPU

A test code to check whether tensorflow recognizes GPU
mail@pastecode.io avatar
unknown
python
2 years ago
175 B
17
Indexable
Never
import tensorflow as tf
if tf.test.gpu_device_name():
    print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
else:
    print("Please install GPU version of TF")