使用cvte预训练模型

cvte开放了已经训练好的模型,不用再花费大量时间和算力去训练,但注意cvte没有开源数据集和模型配置

获取模型

http://kaldi-asr.org/models/m2 下载 0002_cvte_chain_model.tar.gz(3.5G)

解压缩到kaldi/egs下,注意kaldi/egs/换成安装kaldi对应的目录:

tar -zxvf 0002_cvte_chain_model.tar.gz -C kaldi/egs/

解压生成目录kaldi/egs/cvte,按照cvte/README.txt链接stepsutilsscore.sh,由于需要修改utils中的脚本,这里直接拷贝utils文件夹:

cd kaldi/egs/cvte/s5/
ln -s ../../wsj/s5/steps steps
#ln -s ../../wsj/s5/utils utils
cp -r ../../wsj/s5/utils utils
cd local/
ln -s ../steps/score_kaldi.sh score.sh

修改解码脚本

修改utils/lang/check_phones_compatible.sh为:

# check if the files exist or not
if [ ! -f $table_first ]; then
  if [ ! -f $table_second ]; then
    echo "$0: Error! Both of the two phones-symbol tables are absent."
    echo "Please check your command"
    #exit 1; 这里注释掉
  else
    # The phones-symbol-table1 is absent. The model directory maybe created by old script.
    # For back compatibility, this script exits silently with status 0.
    exit 0;
  fi
elif [ ! -f $table_second ]; then
  # The phones-symbol-table2 is absent. The model directory maybe created by old script.
  # For back compatibility, this script exits silently with status 0.
  exit 0;
fi

运行解码测试

chmod +x *.sh
./run.sh

需要在大内存平台上,在本地12G内存的计算机上由于内存不够而出错

上一页
下一页