Closed AnsusBega closed 6 years ago
I solved the problem setting the session before importing keras in train.py:
""" Train our RNN on extracted features or images. """ import tensorflow as tf config = tf.ConfigProto() config.gpu_options.allow_growth = True session = tf.Session(config=config) from keras.callbacks import TensorBoard, ModelCheckpoint, EarlyStopping, CSVLogger
Thanks for sharing!
Hi,
I'd like to limit the memory of each GPU. I found the following code and I paste it in train.py, but it doesn't work. What am I doing wrong? Thanks in advance.
if name == 'main': config = tf.ConfigProto() config.gpu_options.allow_growth = False config.gpu_options.per_process_gpu_memory_fraction = 0.5 set_session(tf.Session(config=config)) main()