fix recipe train and avg shell

pull/812/head
Hui Zhang 3 years ago
parent b105c63eb6
commit d028c8416d

@ -1,20 +0,0 @@
#!/bin/bash
source path.sh
# run on MacOS
# brew install portaudio
# pip install pyaudio
# pip install keyboard
# start demo client
python3 -u ${BIN_DIR}/deploy/client.py \
--host_ip="localhost" \
--host_port=8086 \
if [ $? -ne 0 ]; then
echo "Failed in starting demo client!"
exit 1
fi
exit 0

@ -1,40 +0,0 @@
#!/bin/bash
# TODO: replace the model with a mandarin model
if [[ $# != 1 ]];then
echo "usage: $1 checkpoint_path"
exit -1
fi
source path.sh
# download language model
bash local/download_lm_ch.sh
if [ $? -ne 0 ]; then
exit 1
fi
# download well-trained model
#bash local/download_model.sh
#if [ $? -ne 0 ]; then
# exit 1
#fi
# start demo server
CUDA_VISIBLE_DEVICES=0 \
python3 -u ${BIN_DIR}/deploy/server.py \
--device 'gpu' \
--nproc 1 \
--config conf/deepspeech2.yaml \
--host_ip="localhost" \
--host_port=8086 \
--speech_save_dir="demo_cache" \
--checkpoint_path ${1}
if [ $? -ne 0 ]; then
echo "Failed in starting demo server!"
exit 1
fi
exit 0

@ -20,7 +20,7 @@ fi
mkdir -p exp
seed=10086
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
export FLAGS_cudnn_deterministic=True
fi
@ -32,7 +32,7 @@ python3 -u ${BIN_DIR}/train.py \
--model_type ${model_type} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
unset FLAGS_cudnn_deterministic
fi

@ -1,28 +0,0 @@
#!/bin/bash
# grid-search for hyper-parameters in language model
python3 -u ${BIN_DIR}/tune.py \
--device 'gpu' \
--nproc 1 \
--config conf/deepspeech2.yaml \
--num_batches=10 \
--batch_size=128 \
--beam_size=300 \
--num_proc_bsearch=8 \
--num_alphas=10 \
--num_betas=10 \
--alpha_from=0.0 \
--alpha_to=5.0 \
--beta_from=-6 \
--beta_to=6 \
--cutoff_prob=1.0 \
--cutoff_top_n=40 \
--checkpoint_path ${1}
if [ $? -ne 0 ]; then
echo "Failed in tuning!"
exit 1
fi
exit 0

@ -27,7 +27,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

@ -19,8 +19,8 @@ echo "using ${device}..."
mkdir -p exp
seed=1024
if [ ${seed} ]; then
seed=10086
if [ ${seed} != 0]; then
export FLAGS_cudnn_deterministic=True
fi
@ -31,7 +31,7 @@ python3 -u ${BIN_DIR}/train.py \
--output exp/${ckpt_name} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
unset FLAGS_cudnn_deterministic
fi

@ -25,7 +25,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

@ -19,8 +19,8 @@ echo "using ${device}..."
mkdir -p exp
seed=1024
if [ ${seed} ]; then
seed=10086
if [ ${seed} != 0]; then
export FLAGS_cudnn_deterministic=True
fi
@ -31,7 +31,7 @@ python3 -u ${BIN_DIR}/train.py \
--output exp/${ckpt_name} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
unset FLAGS_cudnn_deterministic
fi

@ -25,7 +25,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

@ -1,10 +1,17 @@
# LibriSpeech
## Data
| Data Subset | Duration in Seconds |
| --- | --- |
| data/manifest.train | 0.83s ~ 29.735s |
| data/manifest.dev | 1.065 ~ 35.155s |
| data/manifest.test-clean | 1.285s ~ 34.955s |
## Deepspeech2
| Model | Params | release | Config | Test set | Loss | WER |
| --- | --- | --- | --- | --- | --- | --- |
| DeepSpeech2 | 42.96M | 2.2.0 | conf/deepspeech2.yaml + spec_aug | 14.49190807 | test-clean | 0.067283 |
| DeepSpeech2 | 42.96M | 2.1.0 | conf/deepspeech2.yaml | 15.184467315673828 | test-clean | 0.072154 |
| DeepSpeech2 | 42.96M | 2.0.0 | conf/deepspeech2.yaml | - | test-clean | 0.073973 |
| DeepSpeech2 | 42.96M | 2.2.0 | conf/deepspeech2.yaml + spec_aug | test-clean | 14.49190807 | 0.067283 |
| DeepSpeech2 | 42.96M | 2.1.0 | conf/deepspeech2.yaml | test-clean | 15.184467315673828 | 0.072154 |
| DeepSpeech2 | 42.96M | 2.0.0 | conf/deepspeech2.yaml | test-clean | - | 0.073973 |
| DeepSpeech2 | 42.96M | 1.8.5 | - | test-clean | - | 0.074939 |

@ -20,8 +20,8 @@ echo "using ${device}..."
mkdir -p exp
seed=1024
if [ ${seed} ]; then
seed=10086
if [ ${seed} != 0 ]; then
export FLAGS_cudnn_deterministic=True
fi
@ -33,7 +33,7 @@ python3 -u ${BIN_DIR}/train.py \
--model_type ${model_type} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
unset FLAGS_cudnn_deterministic
fi

@ -1,33 +0,0 @@
#!/bin/bash
if [ $# != 1 ];then
echo "usage: tune ckpt_path"
exit 1
fi
# grid-search for hyper-parameters in language model
python3 -u ${BIN_DIR}/tune.py \
--device 'gpu' \
--nproc 1 \
--config conf/deepspeech2.yaml \
--num_batches=-1 \
--batch_size=128 \
--beam_size=500 \
--num_proc_bsearch=12 \
--num_alphas=45 \
--num_betas=8 \
--alpha_from=1.0 \
--alpha_to=3.2 \
--beta_from=0.1 \
--beta_to=0.45 \
--cutoff_prob=1.0 \
--cutoff_top_n=40 \
--checkpoint_path ${1}
if [ $? -ne 0 ]; then
echo "Failed in tuning!"
exit 1
fi
exit 0

@ -25,7 +25,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

@ -19,8 +19,8 @@ echo "using ${device}..."
mkdir -p exp
seed=1024
if [ ${seed} ]; then
seed=10086
if [ ${seed} != 0]; then
export FLAGS_cudnn_deterministic=True
fi
@ -31,7 +31,7 @@ python3 -u ${BIN_DIR}/train.py \
--output exp/${ckpt_name} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0]; then
unset FLAGS_cudnn_deterministic
fi

@ -24,7 +24,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

@ -19,8 +19,8 @@ echo "using ${device}..."
mkdir -p exp
seed=1024
if [ ${seed} ]; then
seed=10086
if [ ${seed} != 0 ]; then
export FLAGS_cudnn_deterministic=True
fi
@ -32,7 +32,7 @@ python3 -u ${BIN_DIR}/train.py \
--output exp/${ckpt_name} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
unset FLAGS_cudnn_deterministic
fi

@ -25,7 +25,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

@ -1,3 +1,3 @@
# Punctation Restoration
Please using `https://github.com/745165806/PaddleSpeechTask` to do this task.
Please using [PaddleSpeechTask](https://github.com/745165806/PaddleSpeechTask] to do this task.

@ -19,8 +19,8 @@ echo "using ${device}..."
mkdir -p exp
seed=1024
if [ ${seed} ]; then
seed=10086
if [ ${seed} != 0 ]; then
export FLAGS_cudnn_deterministic=True
fi
@ -31,7 +31,7 @@ python3 -u ${BIN_DIR}/train.py \
--output exp/${ckpt_name} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
unset FLAGS_cudnn_deterministic
fi

@ -26,7 +26,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
../../utils/avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

@ -19,8 +19,8 @@ echo "using ${device}..."
mkdir -p exp
seed=1024
if [ ${seed} ]; then
seed=10086
if [ ${seed} != 0 ]; then
export FLAGS_cudnn_deterministic=True
fi
@ -31,7 +31,7 @@ python3 -u ${BIN_DIR}/train.py \
--output exp/${ckpt_name} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
unset FLAGS_cudnn_deterministic
fi

@ -26,7 +26,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

@ -19,8 +19,8 @@ fi
mkdir -p exp
seed=1024
if [ ${seed} ]; then
seed=10086
if [ ${seed} != 0 ]; then
export FLAGS_cudnn_deterministic=True
fi
@ -32,7 +32,7 @@ python3 -u ${BIN_DIR}/train.py \
--model_type ${model_type} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
unset FLAGS_cudnn_deterministic
fi

@ -27,7 +27,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

@ -18,8 +18,8 @@ fi
mkdir -p exp
seed=1024
if [ ${seed} ]; then
seed=10086
if [ ${seed} != 0 ]; then
export FLAGS_cudnn_deterministic=True
fi
@ -30,7 +30,7 @@ python3 -u ${BIN_DIR}/train.py \
--output exp/${ckpt_name} \
--seed ${seed}
if [ ${seed} ]; then
if [ ${seed} != 0 ]; then
unset FLAGS_cudnn_deterministic
fi

@ -25,7 +25,7 @@ fi
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
# avg n best model
avg.sh exp/${ckpt}/checkpoints ${avg_num}
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
fi
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then

Loading…
Cancel
Save