Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
13a4bee8
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
1 年多 前同步成功
通知
207
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
13a4bee8
编写于
10月 12, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
using simple test for multi decode type, and gpu
上级
4f99dca8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
69 addition
and
43 deletion
+69
-43
examples/librispeech/s1/local/test.sh
examples/librispeech/s1/local/test.sh
+68
-42
examples/librispeech/s1/run.sh
examples/librispeech/s1/run.sh
+1
-1
未找到文件。
examples/librispeech/s1/local/test.sh
浏览文件 @
13a4bee8
...
...
@@ -11,14 +11,12 @@ lmtag=
recog_set
=
"test-clean test-other dev-clean dev-other"
recog_set
=
"test-clean"
# bpemode (unigram or bpe)
nbpe
=
5000
bpemode
=
unigram
bpeprefix
=
"data/bpe_
${
bpemode
}
_
${
nbpe
}
"
bpemodel
=
${
bpeprefix
}
.model
if
[
$#
!=
3
]
;
then
echo
"usage:
${
0
}
config_path dict_path ckpt_path_prefix"
stage
=
0
stop_stage
=
100
if
[
$#
!=
2
]
;
then
echo
"usage:
${
0
}
config_path ckpt_path_prefix"
exit
-1
fi
...
...
@@ -26,8 +24,7 @@ ngpu=$(echo $CUDA_VISIBLE_DEVICES | awk -F "," '{print NF}')
echo
"using
$ngpu
gpus..."
config_path
=
$1
dict
=
$2
ckpt_prefix
=
$3
ckpt_prefix
=
$2
chunk_mode
=
false
if
[[
${
config_path
}
=
~ ^.
*
chunk_.
*
yaml
$
]]
;
then
...
...
@@ -42,46 +39,75 @@ echo "chunk mode ${chunk_mode}"
# exit 1
#fi
pids
=()
# initialize pids
for
dmethd
in
attention ctc_greedy_search ctc_prefix_beam_search attention_rescoring
;
do
(
for
rtask
in
${
recog_set
}
;
do
(
decode_dir
=
decode_
${
rtask
}
_
${
dmethd
}
_
$(
basename
${
config_path
%.*
}
)
_
${
lmtag
}
feat_recog_dir
=
${
datadir
}
mkdir
-p
${
expdir
}
/
${
decode_dir
}
mkdir
-p
${
feat_recog_dir
}
# split data
split_json.sh
${
feat_recog_dir
}
/manifest.
${
rtask
}
${
nj
}
#### use CPU for decoding
ngpu
=
0
# set batchsize 0 to disable batch decoding
batch_size
=
1
${
decode_cmd
}
JOB
=
1:
${
nj
}
${
expdir
}
/
${
decode_dir
}
/log/decode.JOB.log
\
python3
-u
${
BIN_DIR
}
/test.py
\
if
[
${
stage
}
-le
0
]
&&
[
${
stop_stage
}
-ge
0
]
;
then
for
type
in
attention
;
do
echo
"decoding
${
type
}
"
if
[
${
chunk_mode
}
==
true
]
;
then
# stream decoding only support batchsize=1
batch_size
=
1
else
batch_size
=
64
fi
python3
-u
${
BIN_DIR
}
/test.py
\
--nproc
${
ngpu
}
\
--config
${
config_path
}
\
--result_file
${
expdir
}
/
${
decode_dir
}
/data.JOB.json
\
--result_file
${
ckpt_prefix
}
.
${
type
}
.rsl
\
--checkpoint_path
${
ckpt_prefix
}
\
--opts
decoding.decoding_method
${
dmethd
}
\
--opts
decoding.batch_size
${
batch_size
}
\
--opts
data.test_manifest
${
feat_recog_dir
}
/split
${
nj
}
/JOB/manifest.
${
rtask
}
--opts
decoding.decoding_method
${
type
}
\
--opts
decoding.batch_size
${
batch_size
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in evaluation!"
exit
1
fi
echo
"decoding
${
type
}
done."
done
fi
score_sclite.sh
--bpe
${
nbpe
}
--bpemodel
${
bpemodel
}
.model
--wer
true
${
expdir
}
/
${
decode_dir
}
${
dict
}
for
type
in
ctc_greedy_search
;
do
echo
"decoding
${
type
}
"
if
[
${
chunk_mode
}
==
true
]
;
then
# stream decoding only support batchsize=1
batch_size
=
1
else
batch_size
=
64
fi
python3
-u
${
BIN_DIR
}
/test.py
\
--nproc
${
ngpu
}
\
--config
${
config_path
}
\
--result_file
${
ckpt_prefix
}
.
${
type
}
.rsl
\
--checkpoint_path
${
ckpt_prefix
}
\
--opts
decoding.decoding_method
${
type
}
\
--opts
decoding.batch_size
${
batch_size
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in evaluation!"
exit
1
fi
echo
"decoding
${
type
}
done."
done
)
&
pids+
=(
$!
)
# store background pids
done
)
&
pids+
=(
$!
)
# store background pids
for
type
in
ctc_prefix_beam_search attention_rescoring
;
do
echo
"decoding
${
type
}
"
batch_size
=
1
python3
-u
${
BIN_DIR
}
/test.py
\
--nproc
${
ngpu
}
\
--config
${
config_path
}
\
--result_file
${
ckpt_prefix
}
.
${
type
}
.rsl
\
--checkpoint_path
${
ckpt_prefix
}
\
--opts
decoding.decoding_method
${
type
}
\
--opts
decoding.batch_size
${
batch_size
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in evaluation!"
exit
1
fi
echo
"decoding
${
type
}
done."
done
i
=
0
;
for
pid
in
"
${
pids
[@]
}
"
;
do
wait
${
pid
}
||
((
++i
))
;
done
[
${
i
}
-gt
0
]
&&
echo
"
$0
:
${
i
}
background jobs are failed."
&&
false
echo
"Finished"
exit
0
examples/librispeech/s1/run.sh
浏览文件 @
13a4bee8
...
...
@@ -7,7 +7,7 @@ set -e
stage
=
0
stop_stage
=
100
conf_path
=
conf/transformer.yaml
avg_num
=
5
avg_num
=
30
.
${
MAIN_ROOT
}
/utils/parse_options.sh
||
exit
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录