【问题标题】:Subprocess call error while calling generate_lm.py of DeepSpeech调用 DeepSpeech 的 generate_lm.py 时子进程调用错误
【发布时间】:2021-11-20 05:55:22
【问题描述】:

我正在尝试使用 colab 中的 DeepSpeech 为语音转文本构建自定义记分器(语言模型)。调用 generate_lm.py 时出现此错误:

    main()
  File "generate_lm.py", line 201, in main
    build_lm(args, data_lower, vocab_str)
  File "generate_lm.py", line 126, in build_lm
    binary_path,
  File "/usr/lib/python3.7/subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/content/DeepSpeech/native_client/kenlm/build/bin/build_binary', '-a', '255', '-q', '8', '-v', 'trie', '/content/DeepSpeech/data/lm/lm_filtered.arpa', '/content/DeepSpeech/data/lm/lm.binary']' died with <Signals.SIGSEGV: 11>.```

Calling the script generate_lm.py like this :

```! python3 generate_lm.py --input_txt hindi_tokens.txt --output_dir /content/DeepSpeech/data/lm --top_k 500000 --kenlm_bins /content/DeepSpeech/native_client/kenlm/build/bin/ --arpa_order 5 --max_arpa_memory "85%" --arpa_prune "0|0|1" --binary_a_bits 255 --binary_q_bits 8 --binary_type trie```

【问题讨论】:

  • 一些问题来澄清您的环境: - 您是如何安装KenLM 二进制文件的? - 它们是预制的吗?这里发生的是SIGSEGV - 或分段违规。这意味着程序正在尝试访问内存中未被授权使用的位置。当KenLMgenerate_lm.py 使用的软件)发生这种情况时,通常是因为使用了错误的二进制文件。这在 DeepSpeech PlayBook - mozilla.github.io/deepspeech-playbook/SCORER.html 中有更详细的解释
  • 它不是预先构建的。在 DeepSpeech/native_client 中找到 kenlm 文件夹,但是其中没有任何构建文件夹。所以克隆了 kenlm git repo 并自己安装。
  • 你用pip install https://github.com/kpu/kenlm/archive/master.zip安装了吗?
  • 不是点子。克隆 kenlm 的 git repo 并按照给出的说明进行操作。喜欢,mkdir -p build cd build cmake .. make -j 4
  • 好的,这应该仍然有效。有什么方法可以从 Colab 进行堆栈跟踪?

标签: python speech-to-text language-model mozilla-deepspeech


【解决方案1】:

能够找到上述问题的解决方案。将top_k 的值减少到 15000 后成功创建语言模型。我的短语文件只有大约 42000 个条目。我们必须根据我们集合中的短语数量调整top_k 值。 top_k 参数表示 - 在处理之前将删除这些频率较低的短语。

【讨论】:

    猜你喜欢
    • 2017-02-19
    • 1970-01-01
    • 1970-01-01
    • 2015-05-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多