|
|
@ -8,11 +8,6 @@ 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..."
|
|
|
|
|
|
|
|
|
|
|
|
device=gpu
|
|
|
|
|
|
|
|
if [ ${ngpu} == 0 ];then
|
|
|
|
|
|
|
|
device=cpu
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_path=$1
|
|
|
|
config_path=$1
|
|
|
|
ckpt_prefix=$2
|
|
|
|
ckpt_prefix=$2
|
|
|
|
|
|
|
|
|
|
|
@ -39,8 +34,7 @@ for type in attention ctc_greedy_search; do
|
|
|
|
output_dir=${ckpt_prefix}
|
|
|
|
output_dir=${ckpt_prefix}
|
|
|
|
mkdir -p ${output_dir}
|
|
|
|
mkdir -p ${output_dir}
|
|
|
|
python3 -u ${BIN_DIR}/test.py \
|
|
|
|
python3 -u ${BIN_DIR}/test.py \
|
|
|
|
--device ${device} \
|
|
|
|
--nproc ${ngpu} \
|
|
|
|
--nproc 1 \
|
|
|
|
|
|
|
|
--config ${config_path} \
|
|
|
|
--config ${config_path} \
|
|
|
|
--result_file ${output_dir}/${type}.rsl \
|
|
|
|
--result_file ${output_dir}/${type}.rsl \
|
|
|
|
--checkpoint_path ${ckpt_prefix} \
|
|
|
|
--checkpoint_path ${ckpt_prefix} \
|
|
|
@ -58,8 +52,7 @@ for type in ctc_prefix_beam_search attention_rescoring; do
|
|
|
|
output_dir=${ckpt_prefix}
|
|
|
|
output_dir=${ckpt_prefix}
|
|
|
|
mkdir -p ${output_dir}
|
|
|
|
mkdir -p ${output_dir}
|
|
|
|
python3 -u ${BIN_DIR}/test.py \
|
|
|
|
python3 -u ${BIN_DIR}/test.py \
|
|
|
|
--device ${device} \
|
|
|
|
--nproc ${ngpu} \
|
|
|
|
--nproc 1 \
|
|
|
|
|
|
|
|
--config ${config_path} \
|
|
|
|
--config ${config_path} \
|
|
|
|
--result_file ${output_dir}/${type}.rsl \
|
|
|
|
--result_file ${output_dir}/${type}.rsl \
|
|
|
|
--checkpoint_path ${ckpt_prefix} \
|
|
|
|
--checkpoint_path ${ckpt_prefix} \
|
|
|
|