我正在尝试运行TF SLIM中的一个教程,在这个教程中,您可以使用Inception-V3 (~104Mb)对flowers数据集进行微调。GPU大约有2 2Gb的内存。当批处理大小超过8个时,我会收到一个错误,因为GPU内存不足。事实上,我似乎收到了几条消息,每条消息看起来都是这样的:
W tensorflow/core/common_runtime/bfc_allocator.cc:217] Ran out of memory trying to allocate 646.50MiB. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory is available.和
W tensorflow/core/common_runtime/bfc_allocator.cc:274] **************************************x*************************************************************
W tensorflow/core/common_runtime/bfc_allocator.cc:275] Ran out of memory trying to allocate 168.8KiB. See logs for memory state.现在,很可能是我的GPU内存不够大。然而,2 2GB似乎足以加载一个~100Mb的模型。此外,使用Caffe我可以对Alexnet (~400Mb)进行微调,没有任何问题。此外,我还尝试考虑GPU的增长(根据我对系统RAM的理解)
session_config = tf.ConfigProto(allow_soft_placement=True)
session_config.gpu_options.allow_growth = True
session_config.gpu_options.allocator_type = 'BFC'"但这似乎没有帮助。
你知道如果
a)我做错了什么b) GPU不够大c) TF Slim通过构造太多内存消耗
谢谢,
发布于 2017-03-07 05:21:40
是否有其他进程正在使用足够的GPU内存,而tensorflow所剩的内存不多?我相信nvidia-smi会告诉你已经使用了多少图形处理器内存。
如果不是这样,您可能需要查看分配情况,以了解发生了什么情况。参见this other question on how to log allocations from tensorflow。
https://stackoverflow.com/questions/42565223
复制相似问题