tf-slim :(不合理?)用完记忆



我试图在TF Slim中运行其中一个教程,该教程是您使用Inception-V3(〜104MB)微调花数据集的一个教程。GPU有大约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还不够大的RAM。但是,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通过施工过多的内存消耗

谢谢,

其他一些过程是否可以使用足够的GPU内存,以至于tensorflow剩下太多?我相信nvidia-smi会告诉您已经使用了多少GPU内存。

如果不是这种情况,您可能想查看分配以查看发生了什么。查看有关如何从TensorFlow记录分配的其他问题。

最新更新