Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
09ab9f71
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 2 年 前同步成功
通知
210
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看板
提交
09ab9f71
编写于
5月 07, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix s0 scripts
上级
1635e000
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
193 addition
and
160 deletion
+193
-160
examples/aishell/s0/conf/deepspeech2.yaml
examples/aishell/s0/conf/deepspeech2.yaml
+3
-0
examples/aishell/s0/local/infer.sh
examples/aishell/s0/local/infer.sh
+0
-27
examples/aishell/s0/local/test.sh
examples/aishell/s0/local/test.sh
+9
-3
examples/aishell/s1/conf/conformer.yaml
examples/aishell/s1/conf/conformer.yaml
+2
-2
examples/librispeech/s0/local/download_model.sh
examples/librispeech/s0/local/download_model.sh
+0
-21
examples/librispeech/s0/local/export.sh
examples/librispeech/s0/local/export.sh
+20
-6
examples/librispeech/s0/local/infer.sh
examples/librispeech/s0/local/infer.sh
+0
-25
examples/librispeech/s0/local/test.sh
examples/librispeech/s0/local/test.sh
+20
-5
examples/librispeech/s0/local/train.sh
examples/librispeech/s0/local/train.sh
+19
-9
examples/librispeech/s0/run.sh
examples/librispeech/s0/run.sh
+29
-11
examples/tiny/s0/local/export.sh
examples/tiny/s0/local/export.sh
+20
-6
examples/tiny/s0/local/infer.sh
examples/tiny/s0/local/infer.sh
+0
-26
examples/tiny/s0/local/test.sh
examples/tiny/s0/local/test.sh
+20
-4
examples/tiny/s0/local/train.sh
examples/tiny/s0/local/train.sh
+21
-6
examples/tiny/s0/run.sh
examples/tiny/s0/run.sh
+30
-9
未找到文件。
examples/aishell/s0/conf/deepspeech2.yaml
浏览文件 @
09ab9f71
...
...
@@ -22,18 +22,21 @@ data:
sortagrad
:
True
shuffle_method
:
batch_shuffle
num_workers
:
0
model
:
num_conv_layers
:
2
num_rnn_layers
:
3
rnn_layer_size
:
1024
use_gru
:
True
share_rnn_weights
:
False
training
:
n_epoch
:
50
lr
:
2e-3
lr_decay
:
0.83
weight_decay
:
1e-06
global_grad_clip
:
5.0
decoding
:
batch_size
:
128
error_rate_type
:
cer
...
...
examples/aishell/s0/local/infer.sh
已删除
100644 → 0
浏览文件 @
1635e000
#! /usr/bin/env bash
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
}
/infer.py
\
--device
'gpu'
\
--nproc
1
\
--config
conf/deepspeech2.yaml
\
--checkpoint_path
${
1
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in inference!"
exit
1
fi
exit
0
examples/aishell/s0/local/test.sh
浏览文件 @
09ab9f71
#! /usr/bin/env bash
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
\
python3
-u
${
BIN_DIR
}
/
infer
.py
\
--device
'gpu'
\
--nproc
1
\
--config
conf/deepspeech2.yaml
\
--output
ckpt
--checkpoint_path
${
1
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in
evaluation
!"
echo
"Failed in
inference
!"
exit
1
fi
...
...
examples/aishell/s1/conf/conformer.yaml
浏览文件 @
09ab9f71
...
...
@@ -24,7 +24,7 @@ data:
n_fft
:
None
stride_ms
:
10.0
window_ms
:
25.0
use_dB_normalization
:
True
use_dB_normalization
:
False
target_dB
:
-20
random_seed
:
0
keep_transcription_text
:
False
...
...
@@ -74,7 +74,7 @@ model:
training
:
n_epoch
:
24
0
n_epoch
:
30
0
accum_grad
:
2
global_grad_clip
:
5.0
optim
:
adam
...
...
examples/librispeech/s0/local/download_model.sh
已删除
100644 → 0
浏览文件 @
1635e000
#! /usr/bin/env bash
.
${
MAIN_ROOT
}
/utils/utility.sh
DIR
=
data/pretrain
mkdir
-p
${
DIR
}
URL
=
'https://deepspeech.bj.bcebos.com/eng_models/librispeech_model_fluid.tar.gz'
MD5
=
fafb11fe57c3ecd107147056453f5348
TARGET
=
${
DIR
}
/librispeech_model_fluid.tar.gz
echo
"Download LibriSpeech model ..."
download
$URL
$MD5
$TARGET
if
[
$?
-ne
0
]
;
then
echo
"Fail to download LibriSpeech model!"
exit
1
fi
tar
-zxvf
$TARGET
-C
${
DIR
}
exit
0
examples/librispeech/s0/local/export.sh
浏览文件 @
09ab9f71
#! /usr/bin/env bash
if
[
$#
!=
2
]
;
then
echo
"usage:
export ckpt_path
jit_model_path"
if
[
$#
!=
3
]
;
then
echo
"usage:
$0
config_path ckpt_prefix
jit_model_path"
exit
-1
fi
ngpu
=
$(
echo
$CUDA_VISIBLE_DEVICES
|
awk
-F
","
'{print NF}'
)
echo
"using
$ngpu
gpus..."
config_path
=
$1
ckpt_path_prefix
=
$2
jit_model_export_path
=
$3
device
=
gpu
if
[
ngpu
==
0
]
;
then
device
=
cpu
fi
python3
-u
${
BIN_DIR
}
/export.py
\
--config
conf/deepspeech2.yaml
\
--checkpoint_path
${
1
}
\
--export_path
${
2
}
--device
${
device
}
\
--nproc
${
ngpu
}
\
--config
${
config_path
}
\
--checkpoint_path
${
ckpt_path_prefix
}
\
--export_path
${
jit_model_export_path
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in e
valuation
!"
echo
"Failed in e
xport
!"
exit
1
fi
...
...
examples/librispeech/s0/local/infer.sh
已删除
100644 → 0
浏览文件 @
1635e000
#! /usr/bin/env bash
if
[[
$#
!=
1
]]
;
then
echo
"usage:
$0
ckpt-path"
exit
-1
fi
# download language model
bash
local
/download_lm_en.sh
if
[
$?
-ne
0
]
;
then
exit
1
fi
python3
-u
${
BIN_DIR
}
/infer.py
\
--device
'gpu'
\
--nproc
1
\
--config
conf/deepspeech2.yaml
\
--checkpoint_path
${
1
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in inference!"
exit
1
fi
exit
0
examples/librispeech/s0/local/test.sh
浏览文件 @
09ab9f71
#! /usr/bin/env bash
if
[
$#
!=
2
]
;
then
echo
"usage:
${
0
}
config_path ckpt_path_prefix"
exit
-1
fi
ngpu
=
$(
echo
$CUDA_VISIBLE_DEVICES
|
awk
-F
","
'{print NF}'
)
echo
"using
$ngpu
gpus..."
device
=
gpu
if
[
ngpu
==
0
]
;
then
device
=
cpu
fi
config_path
=
$1
ckpt_prefix
=
$2
# download language model
bash
local
/download_lm_en.sh
if
[
$?
-ne
0
]
;
then
exit
1
exit
1
fi
python3
-u
${
BIN_DIR
}
/test.py
\
--device
'gpu'
\
--device
${
device
}
\
--nproc
1
\
--config
conf/deepspeech2.yaml
\
--
output
ckpt
--config
${
config_path
}
\
--
result_file
${
ckpt_prefix
}
.rsl
\
--checkpoint_path
${
ckpt_prefix
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in evaluation!"
...
...
examples/librispeech/s0/local/train.sh
浏览文件 @
09ab9f71
#! /usr/bin/env bash
#export FLAGS_sync_nccl_allreduce=0
# https://github.com/PaddlePaddle/Paddle/pull/28484
#export NCCL_SHM_DISABLE=1
if
[
$#
!=
2
]
;
then
echo
"usage: CUDA_VISIBLE_DEVICES=0
${
0
}
config_path ckpt_name"
exit
-1
fi
ngpu
=
$(
echo
$
{
CUDA_VISIBLE_DEVICES
}
| python
-c
'import sys; a = sys.stdin.read(); print(len(a.split(",")));
'
)
ngpu
=
$(
echo
$
CUDA_VISIBLE_DEVICES
|
awk
-F
","
'{print NF}
'
)
echo
"using
$ngpu
gpus..."
config_path
=
$1
ckpt_name
=
$2
device
=
gpu
if
[
ngpu
==
0
]
;
then
device
=
cpu
fi
echo
"using
${
device
}
..."
mkdir
-p
exp
python3
-u
${
BIN_DIR
}
/train.py
\
--device
'gpu'
\
--device
${
device
}
\
--nproc
${
ngpu
}
\
--config
conf/deepspeech2.yaml
\
--output
ckpt-
${
1
}
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in training!"
exit
1
fi
exit
0
examples/librispeech/s0/run.sh
浏览文件 @
09ab9f71
#!/bin/bash
set
-e
source
path.sh
# prepare data
bash ./local/data.sh
stage
=
0
stop_stage
=
100
conf_path
=
conf/deepspeech2.yaml
ckpt
=
$(
basename
${
conf_path
}
|
awk
-F
'.'
'{print $1}'
)
avg_num
=
1
avg_ckpt
=
avg_
${
avg_num
}
source
${
MAIN_ROOT
}
/utils/parse_options.sh
||
exit
1
;
if
[
${
stage
}
-le
0
]
&&
[
${
stop_stage
}
-ge
0
]
;
then
# prepare data
bash ./local/data.sh
||
exit
-1
fi
# train model
CUDA_VISIBLE_DEVICES
=
0,1,2,3 bash ./local/train.sh
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
4,5,6,7 ./local/train.sh
${
conf_path
}
${
ckpt
}
fi
# test model
CUDA_VISIBLE_DEVICES
=
0 bash ./local/test.sh
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
# avg n best model
./local/avg.sh exp/
${
ckpt
}
/checkpoints
${
avg_num
}
fi
# infer model
CUDA_VISIBLE_DEVICES
=
0 bash ./local/infer.sh ckpt/checkpoints/step-3284
if
[
${
stage
}
-le
3
]
&&
[
${
stop_stage
}
-ge
3
]
;
then
# test ckpt avg_n
CUDA_VISIBLE_DEVICES
=
7 ./local/test.sh
${
conf_path
}
exp/
${
ckpt
}
/checkpoints/
${
avg_ckpt
}
||
exit
-1
fi
# export model
bash ./local/export.sh ckpt/checkpoints/step-3284 jit.model
\ No newline at end of file
if
[
${
stage
}
-le
4
]
&&
[
${
stop_stage
}
-ge
4
]
;
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
\ No newline at end of file
examples/tiny/s0/local/export.sh
浏览文件 @
09ab9f71
#! /usr/bin/env bash
if
[
$#
!=
2
]
;
then
echo
"usage:
export ckpt_path
jit_model_path"
if
[
$#
!=
3
]
;
then
echo
"usage:
$0
config_path ckpt_prefix
jit_model_path"
exit
-1
fi
ngpu
=
$(
echo
$CUDA_VISIBLE_DEVICES
|
awk
-F
","
'{print NF}'
)
echo
"using
$ngpu
gpus..."
config_path
=
$1
ckpt_path_prefix
=
$2
jit_model_export_path
=
$3
device
=
gpu
if
[
ngpu
==
0
]
;
then
device
=
cpu
fi
python3
-u
${
BIN_DIR
}
/export.py
\
--config
conf/deepspeech2.yaml
\
--checkpoint_path
${
1
}
\
--export_path
${
2
}
--device
${
device
}
\
--nproc
${
ngpu
}
\
--config
${
config_path
}
\
--checkpoint_path
${
ckpt_path_prefix
}
\
--export_path
${
jit_model_export_path
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in e
valuation
!"
echo
"Failed in e
xport
!"
exit
1
fi
...
...
examples/tiny/s0/local/infer.sh
已删除
100644 → 0
浏览文件 @
1635e000
#! /usr/bin/env bash
if
[[
$#
!=
1
]]
;
then
echo
"usage:
$0
ckpt-path"
exit
-1
fi
# download language model
bash
local
/download_lm_en.sh
if
[
$?
-ne
0
]
;
then
exit
1
fi
python3
-u
${
BIN_DIR
}
/infer.py
\
--device
'gpu'
\
--nproc
1
\
--config
conf/deepspeech2.yaml
\
--checkpoint_path
${
1
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in inference!"
exit
1
fi
exit
0
examples/tiny/s0/local/test.sh
浏览文件 @
09ab9f71
#! /usr/bin/env bash
if
[
$#
!=
2
]
;
then
echo
"usage:
${
0
}
config_path ckpt_path_prefix"
exit
-1
fi
ngpu
=
$(
echo
$CUDA_VISIBLE_DEVICES
|
awk
-F
","
'{print NF}'
)
echo
"using
$ngpu
gpus..."
device
=
gpu
if
[
ngpu
==
0
]
;
then
device
=
cpu
fi
config_path
=
$1
ckpt_prefix
=
$2
# download language model
bash
local
/download_lm_en.sh
if
[
$?
-ne
0
]
;
then
exit
1
exit
1
fi
python3
-u
${
BIN_DIR
}
/test.py
\
--device
'gpu'
\
--device
${
device
}
\
--nproc
1
\
--config
conf/deepspeech2.yaml
\
--output
ckpt
--config
${
config_path
}
\
--result_file
${
ckpt_prefix
}
.rsl
\
--checkpoint_path
${
ckpt_prefix
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in evaluation!"
...
...
examples/tiny/s0/local/train.sh
浏览文件 @
09ab9f71
#! /usr/bin/env bash
export
FLAGS_sync_nccl_allreduce
=
0
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}'
)
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
\
--device
'gpu'
\
--nproc
1
\
--config
conf/deepspeech2.yaml
\
--output
ckpt
--device
${
device
}
\
--nproc
${
ngpu
}
\
--config
${
config_path
}
\
--output
exp/
${
ckpt_name
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in training!"
exit
1
fi
exit
0
examples/tiny/s0/run.sh
浏览文件 @
09ab9f71
#!/bin/bash
set
-e
source
path.sh
# prepare data
bash ./local/data.sh
stage
=
0
stop_stage
=
100
conf_path
=
conf/deepspeech2.yaml
ckpt
=
$(
basename
${
conf_path
}
|
awk
-F
'.'
'{print $1}'
)
avg_num
=
1
avg_ckpt
=
avg_
${
avg_num
}
source
${
MAIN_ROOT
}
/utils/parse_options.sh
||
exit
1
;
if
[
${
stage
}
-le
0
]
&&
[
${
stop_stage
}
-ge
0
]
;
then
# prepare data
bash ./local/data.sh
||
exit
-1
fi
if
[
${
stage
}
-le
1
]
&&
[
${
stop_stage
}
-ge
1
]
;
then
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
0 ./local/train.sh
${
conf_path
}
${
ckpt
}
fi
# train model
bash ./local/train.sh
if
[
${
stage
}
-le
2
]
&&
[
${
stop_stage
}
-ge
2
]
;
then
# avg n best model
./local/avg.sh exp/
${
ckpt
}
/checkpoints
${
avg_num
}
fi
# test model
bash ./local/test.sh
if
[
${
stage
}
-le
3
]
&&
[
${
stop_stage
}
-ge
3
]
;
then
# test ckpt avg_n
CUDA_VISIBLE_DEVICES
=
0 ./local/test.sh
${
conf_path
}
exp/
${
ckpt
}
/checkpoints/
${
avg_ckpt
}
||
exit
-1
fi
# infer model
bash ./local/infer.sh
if
[
${
stage
}
-le
4
]
&&
[
${
stop_stage
}
-ge
4
]
;
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录