在linux下运行fcn出现failed to allocate错误,可以从如下几个方面提高GPU的利用率:
1. reduce your batch size
2 .use memory growing:
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config, ...)
3 .don't allocate whole of your GPU memory(only 90%):
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.9
session = tf.Session(config=config, ...)
通过以上设定就可以解决GPU分配的问题了,也可以通过以上设定运行程序的GPU的最大占用率。