Keras TensorFlow 显存溢出问题

Error:

InternalError: Blas GEMM launch failed : a.shape=(4, 23040), b.shape=(23040,...

解决方案:
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session

config = tf.ConfigProto()
config.gpu_options.allocator_type = 'BFC' #A "Best-fit with coalescing" algorithm, simplified from a version of dlmalloc.
config.gpu_options.per_process_gpu_memory_fraction = 0.3
config.gpu_options.allow_growth = True
set_session(tf.Session(config=config)) 

查看显存使用率

你可能感兴趣的:(Keras TensorFlow 显存溢出问题)