Closed sooftware closed 4 years ago
CC @alexeib
Never mind, I solved it.
# Install python libraries
pip install soundfile
pip install torchaudio
pip install sentencepiece
apt-get update \ && apt-get upgrade -y \ && apt-get install -y \ && apt-get -y install apt-utils gcc libpq-dev libsndfile-dev
sudo apt install build-essential cmake libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev libeigen3-dev zlib1g-dev libbz2-dev liblzma-dev git clone https://github.com/kpu/kenlm.git cd kenlm mkdir -p build cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DKENLM_MAX_ORDER=20 -DCMAKE_POSITION_INDEPENDENT_CODE=ON make -j 16 export KENLM_ROOT_DIR=/root/kenlm/ cd ../..
apt-get install libsndfile1-dev libopenblas-dev libfftw3-dev libgflags-dev libgoogle-glog-dev
git clone -b v0.2 https://github.com/facebookresearch/wav2letter.git cd wav2letter/bindings/python pip install -e . cd ../../..
* Run Viterbi
DATASET_PATH=$1 TESTSET=$2 EXT=$3 # flac or wav MODEL_PATH=$4
testset_path=$1$2 tsv_path="./manifest/$2.tsv"
wget https://dl.fbaipublicfiles.com/fairseq/wav2vec/dict.ltr.txt
python examples/wav2vec/wav2vec_manifest.py $testset_path --dest ./manifest/ --ext $EXT --valid-percent 0.0 mv ./manifest/train.tsv $tsv_path python libri_labels.py $tsv_path --output-dir ./manifest/ --output-name $TESTSET mv "./manifest/$2.wrd" "./manifest/$2.wrd.txt"
python examples/speech_recognition/infer.py $testset_path --task audio_pretraining \ --nbest 1 --path $MODEL_PATH --gen-subset $TESTSET --results-path ./manifest/ --w2l-decoder viterbi --word-score -1 \ --sil-weight 0 --criterion ctc --labels ltr --max-tokens 4000000 --post-process letter
❓ Questions and Help
Hi! Thank you for releasing the Wav2vec 2.0 code.
I'm trying to deduce with the Wav2vec pre-train model, but there are some problems.
This is the command I made for setting up the environment, I would appreciate it if you could let me know if there is anything wrong with it, and I think it would be good for people who want to install wav2 letter to refer to this.
After install wav2letter, I install fairseq by git clone.
And while trying many things to deduce, I found and downloaded links to the various files I needed.
letter vocabulary, lexicon
I use the below command to decode by Viterbi
But I encounter this error message
I am embarrassed that this error occurred even though Ken-LM or Transformer LM was not used.
The part I suspect, If I want to refer to test-clean,
test-clean.ltr
needed.But I didn't know where it came from, so I just changed the name of
dict.ltr.txt
. (download from letter vocabulary)I looked at various issues and README, but I still don't know what the problem is. I think it will be a lot of help if you help me. Thank You !!
What's your environment?
pip
, source): git clone today