Added GPU growth

This commit is contained in:
Jordon Brooks 2023-08-17 01:57:43 +01:00
parent 046b78cb87
commit 3ea1568ad3

View file

@ -14,8 +14,18 @@ from featureExtraction import psnr
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
import gc
import tensorflow as tf
from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint
from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint, Callback
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
for gpu in gpus:
tf.config.experimental.set_memory_growth(gpu, True)
except RuntimeError as e:
print(e)
from video_compression_model import VideoCompressionModel, data_generator