【发布时间】: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- 或分段违规。这意味着程序正在尝试访问内存中未被授权使用的位置。当KenLM(generate_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