> 文章列表 > 参考mfa官方文档实践笔记(亲测)

参考mfa官方文档实践笔记(亲测)

参考mfa官方文档实践笔记(亲测)

  1. 按顺序执行以下指令
    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 
  2. 如果报错
    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
  3. 接着执行以下指令:
    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
  4. 对于英文:
    1. 执行以下指令:
      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
    2. 如果报错:
      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.
      1. 原因:不可以在root权限下操作

      2. 解决:切换到普通用户就可以执行了

      3. 如果语料库发生了变化,mfa validate 指令加上--clean

    3. 执行对齐指令:
      mfa align corpus_dir_path english_us_arpa english_us_arpa align_result_dir_path
    4. 如果报错:
      sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly
      This probably means the server terminated abnormally
      before or while processing the request.
      1. 解决:网络问题,再重复执行即可
      2. 注意corpus目录下wav和转录文件需要名字是对应的。
  5. 对于中文
    1. 由于官网给的词典好像用不了,这里(跳转中...,提取码:mma3)提供了准备的词典和声学模型,下载即可
    2. 执行以下指令:
      mfa validate corpus_dir_root dictionary_path acoustic_modle_pathmfa align corpus_dir_root dictionary_path acoustic_modle_path alignment_result_dir