Skip to content

Instantly share code, notes, and snippets.

@ThibautLucas
Created March 1, 2021 17:23
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 ThibautLucas/335d61459809c1d1e14a7940b439cd3d to your computer and use it in GitHub Desktop.
Save ThibautLucas/335d61459809c1d1e14a7940b439cd3d to your computer and use it in GitHub Desktop.
import os
import numpy as np
import cv2
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
tf.get_logger().setLevel('ERROR')
gpus = tf.config.experimental.list_physical_devices('GPU')
for gpu in gpus:
print(gpu)
tf.config.experimental.set_memory_growth(gpu, True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment