You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
49 lines
1.4 KiB
3 years ago
|
#!/bin/bash
|
||
|
set -e
|
||
3 years ago
|
|
||
|
. path.sh || exit 1;
|
||
3 years ago
|
|
||
3 years ago
|
gpus=0,1,2,3
|
||
3 years ago
|
stage=0
|
||
|
stop_stage=50
|
||
|
conf_path=conf/transformer.yaml
|
||
|
avg_num=10
|
||
3 years ago
|
TIMIT_path=/path/to/TIMIT
|
||
3 years ago
|
|
||
|
. ${MAIN_ROOT}/utils/parse_options.sh || exit 1;
|
||
3 years ago
|
|
||
|
avg_ckpt=avg_${avg_num}
|
||
|
ckpt=$(basename ${conf_path} | awk -F'.' '{print $1}')
|
||
|
echo "checkpoint name ${ckpt}"
|
||
|
|
||
|
if [ ${stage} -le 0 ] && [ ${stop_stage} -ge 0 ]; then
|
||
|
# prepare data
|
||
|
bash ./local/timit_data_prep.sh ${TIMIT_path}
|
||
|
bash ./local/data.sh || exit -1
|
||
|
fi
|
||
|
|
||
|
if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then
|
||
|
# train model, all `ckpt` under `exp` dir
|
||
3 years ago
|
CUDA_VISIBLE_DEVICES=${gpus} ./local/train.sh ${conf_path} ${ckpt}
|
||
3 years ago
|
fi
|
||
|
|
||
|
if [ ${stage} -le 2 ] && [ ${stop_stage} -ge 2 ]; then
|
||
|
# avg n best model
|
||
3 years ago
|
avg.sh best exp/${ckpt}/checkpoints ${avg_num}
|
||
3 years ago
|
fi
|
||
|
|
||
|
if [ ${stage} -le 3 ] && [ ${stop_stage} -ge 3 ]; then
|
||
|
# test ckpt avg_n
|
||
3 years ago
|
CUDA_VISIBLE_DEVICES=0 ./local/test.sh ${conf_path} exp/${ckpt}/checkpoints/${avg_ckpt} || exit -1
|
||
3 years ago
|
fi
|
||
|
|
||
|
if [ ${stage} -le 4 ] && [ ${stop_stage} -ge 4 ]; then
|
||
|
# ctc alignment of test data
|
||
|
CUDA_VISIBLE_DEVICES=0 ./local/align.sh ${conf_path} exp/${ckpt}/checkpoints/${avg_ckpt} || exit -1
|
||
|
fi
|
||
|
|
||
3 years ago
|
# if [ ${stage} -le 5 ] && [ ${stop_stage} -ge 5 ]; then
|
||
|
# # export ckpt avg_n
|
||
|
# CUDA_VISIBLE_DEVICES= ./local/export.sh ${conf_path} exp/${ckpt}/checkpoints/${avg_ckpt} exp/${ckpt}/checkpoints/${avg_ckpt}.jit
|
||
|
# fi
|