提交 c693bb08 编写于 作者: H Hui Zhang

fix log, add avg script

上级 ec348147
......@@ -136,7 +136,7 @@ class U2Trainer(Trainer):
msg = f"Valid: Rank: {dist.get_rank()}, "
msg += "epoch: {}, ".format(self.epoch)
msg += "step: {}, ".format(self.iteration)
msg += "batch : {}/{}, ".format(i + 1, len(self.valid_loader))
msg += "batch: {}/{}, ".format(i + 1, len(self.valid_loader))
msg += ', '.join('{}: {:>.6f}'.format(k, v)
for k, v in valid_dump.items())
logger.info(msg)
......
......@@ -90,7 +90,7 @@ training:
decoding:
batch_size: 16
error_rate_type: wer
error_rate_type: cer
decoding_method: attention # 'attention', 'ctc_greedy_search', 'ctc_prefix_beam_search', 'attention_rescoring'
lang_model_path: data/lm/common_crawl_00.prune01111.trie.klm
alpha: 2.5
......
#! /usr/bin/env bash
if [ $# != 2 ];then
echo "usage: ${0} ckpt_path avg_num"
exit -1
fi
ckpt_path=${1}
average_num=${2}
decode_checkpoint=${ckpt_path}/avg_${average_num}.pt
python3 -u ${MAIN_ROOT}/utils/avg_model.py \
--dst_model ${decode_checkpoint} \
--ckpt_dir ${ckpt_path} \
--num ${average_num} \
--val_best
if [ $? -ne 0 ]; then
echo "Failed in avg ckpt!"
exit 1
fi
exit 0
\ No newline at end of file
#! /usr/bin/env bash
if [ $# != 2 ];then
echo "usage: export ckpt_path jit_model_path"
echo "usage: ${0} ckpt_path jit_model_path"
exit -1
fi
......@@ -12,7 +12,7 @@ python3 -u ${BIN_DIR}/export.py \
if [ $? -ne 0 ]; then
echo "Failed in evaluation!"
echo "Failed in export!"
exit 1
fi
......
#! /usr/bin/env bash
# download language model
bash local/download_lm_ch.sh
if [ $? -ne 0 ]; then
exit 1
if [ $# != 1 ];then
echo "usage: ${0} ckpt_path"
exit -1
fi
# download language model
#bash local/download_lm_ch.sh
#if [ $? -ne 0 ]; then
# exit 1
#fi
python3 -u ${BIN_DIR}/test.py \
--device 'gpu' \
--nproc 1 \
--config conf/conformer.yaml \
--output ckpt
--result_file ${1}.rsl \
--checkpoint_path ${1}
if [ $? -ne 0 ]; then
echo "Failed in evaluation!"
......
#! /usr/bin/env bash
if [ $# != 1 ];then
echo "usage: ${0} ckpt_tag"
exit -1
fi
ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
echo "using $ngpu gpus..."
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册