参考mfa官方文档实践笔记(亲测)
- 按顺序执行以下指令:
conda create -n aligner -c conda-forge montreal-forced-alignerconda config --add channels conda-forgeconda activate alignerconda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
- 如果报错:
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
替换为pip 执行指令:
pip3 install torch torchvision torchaudio -i https://pypi.tuna.tsinghua.edu.cn/simple
- 接着执行以下指令:
pip install speechbrain -i https://pypi.tuna.tsinghua.edu.cn/simple conda update --all pip uninstall montreal-forced-aligner conda install -c conda-forge montreal-forced-aligner
- 对于英文:
- 执行以下指令:
mfa model download acoustic english_us_arpamfa model download dictionary english_us_arpa mfa model inspect acoustic english_us_arpa // 可以看到声学模型的一些特性mfa validate corpus_dir_path english_us_arpa english_us_arpa
- 如果报错:
initdb: error: cannot be run as root initdb: hint: Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.
-
原因:不可以在root权限下操作
-
解决:切换到普通用户就可以执行了
-
如果语料库发生了变化,mfa validate 指令加上--clean
-
- 执行对齐指令:
mfa align corpus_dir_path english_us_arpa english_us_arpa align_result_dir_path
- 如果报错:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
- 解决:网络问题,再重复执行即可
- 注意corpus目录下wav和转录文件需要名字是对应的。
- 执行以下指令:
- 对于中文
- 由于官网给的词典好像用不了,这里(跳转中...,提取码:mma3)提供了准备的词典和声学模型,下载即可
- 执行以下指令:
mfa validate corpus_dir_root dictionary_path acoustic_modle_pathmfa align corpus_dir_root dictionary_path acoustic_modle_path alignment_result_dir