如何解决这个 Kaldi ASR MFCC 特征提取
How to resolve this Kaldi ASR MFCC feature Extraction
我遇到了一些与 Kaldi 特征提取相关的问题。我是Kaldi的新手,请帮助我。
OS: Ubuntu 18.04
我目前正在尝试提取 MFCC 特征并从语音中获取 VAD,当我 运行 文件 mfcc.sh
#!/bin/bash
#cd ./allWavFiles/
kaldi_path=~/kaldi
featbin_path=$kaldi_path/src/featbin
ivectorbin_path=$kaldi_path/src/ivectorbin
folder=~/Downloads/
find ./ -iname "*.wav" > files
sed -e 's/.wav//g;s/Audio//g;s/\///g;s/\.//g' files > unique
paste unique files | sed 's/\t/ /g' > wav.scp
mkdir mfcc;
mkdir vad;
count=`ls Audio | wc -l`
for i in `seq 1 $count`;
do
cat wav.scp | head -n $i | tail -1 > wav_1.scp
name=`cat wav_1.scp | cut -d " " -f1`
name=$name'.txt';
#Computing mfccs and copying to archive
$featbin_path/compute-mfcc-feats --frame-length=20 scp,p:wav_1.scp ark:- | $featbin_path/copy-feats --compress=true ark:- ark,scp:test.ark,feats.scp
$featbin_path/add-deltas ark:test.ark ark,scp:test_delta.ark,feats_delta.scp
$ivectorbin_path/compute-vad scp:feats_delta.scp ark,t:vad/$name
$featbin_path/compute-cmvn-stats scp:feats_delta.scp ark,scp:cmvn.ark,cmvn.scp
$featbin_path/apply-cmvn scp:cmvn.scp scp:feats_delta.scp ark,t:mfcc/$name
sed -i '1d' mfcc/$name
sed -i "s/\]//g" mfcc/$name
sed -i 's/.*\[\([^]]*\)\].*//g' vad/$name
done
rm -r files unique wav.scp wav_1.scp feats.scp test.ark test_delta.ark feats_delta.scp cmvn.scp cmvn.ark
#Readable archive
#$path/copy-feats ark:test.ark ark,t:mytext.arkco
我收到了这个错误
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/5.txt: No such file or directory
sed: can't read mfcc/5.txt: No such file or directory
sed: can't read vad/5.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/4.txt: No such file or directory
sed: can't read mfcc/4.txt: No such file or directory
sed: can't read vad/4.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/2.txt: No such file or directory
sed: can't read mfcc/2.txt: No such file or directory
sed: can't read vad/2.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/1.txt: No such file or directory
sed: can't read mfcc/1.txt: No such file or directory
sed: can't read vad/1.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/3.txt: No such file or directory
sed: can't read mfcc/3.txt: No such file or directory
sed: can't read vad/3.txt: No such file or directory
rm: cannot remove 'feats.scp': No such file or directory
rm: cannot remove 'test.ark': No such file or directory
rm: cannot remove 'test_delta.ark': No such file or directory
rm: cannot remove 'feats_delta.scp': No such file or directory
rm: cannot remove 'cmvn.scp': No such file or directory
rm: cannot remove 'cmvn.ark': No such file or directory
即使我提供了正确的 kaldi 路径,它仍然显示这个错误
如果需要,我会提供更多详细信息。请帮我解决这个问题。
谢谢
看来你还没有安装Kaldi。需要编译 Kaldi 二进制文件以使其可执行。您可以按照存储库根目录中 INSTALL 文件中的说明进行安装。
安装完成后,您需要将其添加到您的 PATH 变量中。这可以按照任何示例配方中的任何 path.sh 脚本完成。将它添加到 PATH 后,您可以尝试从命令行 运行 compute-mfcc-feats
,它应该会打印一条用法消息。
我遇到了一些与 Kaldi 特征提取相关的问题。我是Kaldi的新手,请帮助我。
OS: Ubuntu 18.04 我目前正在尝试提取 MFCC 特征并从语音中获取 VAD,当我 运行 文件 mfcc.sh
#!/bin/bash
#cd ./allWavFiles/
kaldi_path=~/kaldi
featbin_path=$kaldi_path/src/featbin
ivectorbin_path=$kaldi_path/src/ivectorbin
folder=~/Downloads/
find ./ -iname "*.wav" > files
sed -e 's/.wav//g;s/Audio//g;s/\///g;s/\.//g' files > unique
paste unique files | sed 's/\t/ /g' > wav.scp
mkdir mfcc;
mkdir vad;
count=`ls Audio | wc -l`
for i in `seq 1 $count`;
do
cat wav.scp | head -n $i | tail -1 > wav_1.scp
name=`cat wav_1.scp | cut -d " " -f1`
name=$name'.txt';
#Computing mfccs and copying to archive
$featbin_path/compute-mfcc-feats --frame-length=20 scp,p:wav_1.scp ark:- | $featbin_path/copy-feats --compress=true ark:- ark,scp:test.ark,feats.scp
$featbin_path/add-deltas ark:test.ark ark,scp:test_delta.ark,feats_delta.scp
$ivectorbin_path/compute-vad scp:feats_delta.scp ark,t:vad/$name
$featbin_path/compute-cmvn-stats scp:feats_delta.scp ark,scp:cmvn.ark,cmvn.scp
$featbin_path/apply-cmvn scp:cmvn.scp scp:feats_delta.scp ark,t:mfcc/$name
sed -i '1d' mfcc/$name
sed -i "s/\]//g" mfcc/$name
sed -i 's/.*\[\([^]]*\)\].*//g' vad/$name
done
rm -r files unique wav.scp wav_1.scp feats.scp test.ark test_delta.ark feats_delta.scp cmvn.scp cmvn.ark
#Readable archive
#$path/copy-feats ark:test.ark ark,t:mytext.arkco
我收到了这个错误
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/5.txt: No such file or directory
sed: can't read mfcc/5.txt: No such file or directory
sed: can't read vad/5.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/4.txt: No such file or directory
sed: can't read mfcc/4.txt: No such file or directory
sed: can't read vad/4.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/2.txt: No such file or directory
sed: can't read mfcc/2.txt: No such file or directory
sed: can't read vad/2.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/1.txt: No such file or directory
sed: can't read mfcc/1.txt: No such file or directory
sed: can't read vad/1.txt: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/compute-mfcc-feats: No such file or directory
./mfcc.sh: line 21: /home/navaneeth/kaldi/src/featbin/copy-feats: No such file or directory
./mfcc.sh: line 22: /home/navaneeth/kaldi/src/featbin/add-deltas: No such file or directory
./mfcc.sh: line 23: /home/navaneeth/kaldi/src/ivectorbin/compute-vad: No such file or directory
./mfcc.sh: line 24: /home/navaneeth/kaldi/src/featbin/compute-cmvn-stats: No such file or directory
./mfcc.sh: line 25: /home/navaneeth/kaldi/src/featbin/apply-cmvn: No such file or directory
sed: can't read mfcc/3.txt: No such file or directory
sed: can't read mfcc/3.txt: No such file or directory
sed: can't read vad/3.txt: No such file or directory
rm: cannot remove 'feats.scp': No such file or directory
rm: cannot remove 'test.ark': No such file or directory
rm: cannot remove 'test_delta.ark': No such file or directory
rm: cannot remove 'feats_delta.scp': No such file or directory
rm: cannot remove 'cmvn.scp': No such file or directory
rm: cannot remove 'cmvn.ark': No such file or directory
即使我提供了正确的 kaldi 路径,它仍然显示这个错误 如果需要,我会提供更多详细信息。请帮我解决这个问题。
谢谢
看来你还没有安装Kaldi。需要编译 Kaldi 二进制文件以使其可执行。您可以按照存储库根目录中 INSTALL 文件中的说明进行安装。
安装完成后,您需要将其添加到您的 PATH 变量中。这可以按照任何示例配方中的任何 path.sh 脚本完成。将它添加到 PATH 后,您可以尝试从命令行 运行 compute-mfcc-feats
,它应该会打印一条用法消息。