Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • DeepSpeech
  • Issue
  • #169

D
DeepSpeech
  • 项目概览

PaddlePaddle / DeepSpeech
大约 2 年 前同步成功

通知 210
Star 8425
Fork 1598
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 245
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 3
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
D
DeepSpeech
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 245
    • Issue 245
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 3
    • 合并请求 3
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 3月 07, 2018 by saxon_zh@saxon_zhGuest

memory leak ctc_beam_search_decoder

Created by: mrfox321

If I repeatedly call the swig decoder ctc_beam_search_decoder, I get a memory leak of around 10MB per iteration.

def score():

    scorer = Scorer(alpha,beta,language_model_path,vocab)
    best_path = ctc_beam_search_decoder(probs_seq2,vocab,beam_size,
                                            cutoff_prob=cutoff_p,cutoff_top_n=cutoff_n,
                                            ext_scoring_func=scorer)
    print best_path[0][1]

for i in range(num_iter):
    score()

Here is the memory profiler output after the first iteration:

Line Mem usage Increment Line Contents ================================================ 21 35.6 MiB 35.6 MiB @profile 22 def score(): 23
24 878.4 MiB 842.7 MiB scorer = Scorer(alpha,beta,language_model_path,vocab) 25 878.4 MiB 0.0 MiB best_path = ctc_beam_search_decoder(probs_seq2,vocab,beam_size, 26 878.4 MiB 0.0 MiB cutoff_prob=cutoff_p,cutoff_top_n=cutoff_n, 27 878.7 MiB 0.4 MiB ext_scoring_func=scorer) 28 878.7 MiB 0.0 MiB print best_path[0][1]

and after N iterations:

Line # Mem usage Increment Line Contents ================================================ 21 1446.4 MiB 1446.4 MiB @profile 22 def score(): 23
24 2061.3 MiB 614.9 MiB scorer = Scorer(alpha,beta,language_model_path,vocab) 25 2061.3 MiB 0.0 MiB best_path = ctc_beam_search_decoder(probs_seq2,vocab,beam_size, 26 2061.3 MiB 0.0 MiB cutoff_prob=cutoff_p,cutoff_top_n=cutoff_n, 27 2061.3 MiB 0.0 MiB ext_scoring_func=scorer) 28 2061.3 MiB 0.0 MiB print best_path[0][1]

it seems that when I change the loop to:

for j in range(100):
    scorer = Scorer(alpha,beta,language_model_path,vocab)
    for i in range(num_iter):
        score()

    del scorer

The memory leak occurs in the outer loop associated with the construction of the scorer. The memory is roughly constant in each inner loop iteration.

Additionally, if I do not run score(), the construction of scorer does not leak.

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/DeepSpeech#169
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7