tensorflow poolallocator
发布日期:2021-11-21 04:41:31 浏览次数:47 分类:技术文章

本文共 1662 字,大约阅读时间需要 5 分钟。

有时使用tensorflow训练模型的时候,会出现上述问题,比如: Raising pool_size_limit_ from 100 to 110

一般情况下,出现此信息并不是运行错误,而是系统为了更加高效地执行训练任务进行的内存处理优化,下面的链接给出了解释

TensorFlow has multiple memory allocators, for memory that will be used in different ways. Their behavior has some adaptive aspects.

In your particular case, since you're using a GPU, there is a PoolAllocator for CPU memory that is pre-registered with the GPU for fast DMA. A tensor that is expected to be transferred from CPU to GPU, e.g., will be allocated from this pool.

The PoolAllocators attempt to amortize the cost of calling a more expensive underlying allocator by keeping around a pool of allocated then freed chunks that are eligible for immediate reuse. Their default behavior is to grow slowly until the eviction rate drops below some constant. (The eviction rate is the proportion of free calls where we return an unused chunk from the pool to the underlying pool in order not to exceed the size limit.) In the log messages above, you see "Raising pool_size_limit_" lines that show the pool size growing. Assuming that your program actually has a steady state behavior with a maximum size collection of chunks it needs, the pool will grow to accommodate it, and then grow no more. It behaves this way rather than simply retaining all chunks ever allocated so that sizes needed only rarely, or only during program startup, are less likely to be retained in the pool.

These messages should only be a cause for concern if you run out of memory. In such a case the log messages may help diagnose the problem. Note also that peak execution speed may only be attained after the memory pools have grown to the proper size.

转载地址:https://blog.csdn.net/xiaojiajia007/article/details/74090012 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:keras data generation, python生成器
下一篇:keras 迁移学习, 微调, model的predict函数定义

发表评论

最新留言

第一次来,支持一个
[***.219.124.196]2024年04月14日 11时43分04秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章