parent
dd96a65892
commit
716bf6f1dd
@ -1 +1,3 @@
|
|||||||
* s0 is for deepspeech
|
# ASR
|
||||||
|
* s0 is for deepspeech2
|
||||||
|
* s1 is for U2
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
data
|
||||||
|
exp
|
||||||
|
log
|
@ -0,0 +1,23 @@
|
|||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
if [ $# != 2 ];then
|
||||||
|
echo "usage: ${0} ckpt_dir avg_num"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ckpt_dir=${1}
|
||||||
|
average_num=${2}
|
||||||
|
decode_checkpoint=${ckpt_dir}/avg_${average_num}.pdparams
|
||||||
|
|
||||||
|
python3 -u ${MAIN_ROOT}/utils/avg_model.py \
|
||||||
|
--dst_model ${decode_checkpoint} \
|
||||||
|
--ckpt_dir ${ckpt_dir} \
|
||||||
|
--num ${average_num} \
|
||||||
|
--val_best
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed in avg ckpt!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
@ -1,18 +1,31 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
if [ $# != 2 ];then
|
||||||
|
echo "usage: CUDA_VISIBLE_DEVICES=0 ${0} config_path ckpt_name"
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
|
ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
|
||||||
echo "using $ngpu gpus..."
|
echo "using $ngpu gpus..."
|
||||||
|
|
||||||
|
config_path=$1
|
||||||
|
ckpt_name=$2
|
||||||
|
device=gpu
|
||||||
|
if [ ngpu != 0 ];then
|
||||||
|
device=cpu
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p exp
|
||||||
|
|
||||||
python3 -u ${BIN_DIR}/train.py \
|
python3 -u ${BIN_DIR}/train.py \
|
||||||
--device 'gpu' \
|
--device ${device} \
|
||||||
--nproc ${ngpu} \
|
--nproc ${ngpu} \
|
||||||
--config conf/conformer.yaml \
|
--config ${config_path} \
|
||||||
--output ckpt-${1}
|
--output exp/${ckpt_name}
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Failed in training!"
|
echo "Failed in training!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in new issue