Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
497cf4e2
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看板
提交
497cf4e2
编写于
4月 29, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix log
上级
f3cecf88
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
11 deletion
+22
-11
deepspeech/exps/u2/bin/test.py
deepspeech/exps/u2/bin/test.py
+1
-1
deepspeech/exps/u2/bin/train.py
deepspeech/exps/u2/bin/train.py
+1
-1
deepspeech/utils/layer_tools.py
deepspeech/utils/layer_tools.py
+2
-2
examples/tiny/s1/local/export.sh
examples/tiny/s1/local/export.sh
+11
-1
examples/tiny/s1/local/train.sh
examples/tiny/s1/local/train.sh
+1
-0
examples/tiny/s1/run.sh
examples/tiny/s1/run.sh
+6
-6
examples/tiny/s1/train.profile
examples/tiny/s1/train.profile
+0
-0
未找到文件。
deepspeech/exps/u2/bin/test.py
浏览文件 @
497cf4e2
...
...
@@ -53,4 +53,4 @@ if __name__ == "__main__":
# Setting for profiling
pr
=
cProfile
.
Profile
()
pr
.
runcall
(
main
,
config
,
args
)
pr
.
dump_stats
(
os
.
path
.
join
(
'.'
,
'test
.profile'
))
pr
.
dump_stats
(
os
.
path
.
join
(
args
.
output
,
'train
.profile'
))
deepspeech/exps/u2/bin/train.py
浏览文件 @
497cf4e2
...
...
@@ -56,4 +56,4 @@ if __name__ == "__main__":
# Setting for profiling
pr
=
cProfile
.
Profile
()
pr
.
runcall
(
main
,
config
,
args
)
pr
.
dump_stats
(
os
.
path
.
join
(
'.'
,
'train.profile'
))
pr
.
dump_stats
(
os
.
path
.
join
(
args
.
output
,
'train.profile'
))
deepspeech/utils/layer_tools.py
浏览文件 @
497cf4e2
...
...
@@ -33,7 +33,7 @@ def summary(layer: nn.Layer, print_func=print):
if
print_func
:
num_elements
=
num_elements
/
1024
**
2
print_func
(
f
"Total parameters:
{
num_params
}
,
{
num_elements
:.
4
f
}
M elements."
)
f
"Total parameters:
{
num_params
}
,
{
num_elements
:.
2
f
}
M elements."
)
def
print_grads
(
model
,
print_func
=
print
):
...
...
@@ -57,7 +57,7 @@ def print_params(model, print_func=print):
print_func
(
msg
)
if
print_func
:
total
=
total
/
1024
**
2
print_func
(
f
"Total parameters:
{
num_params
}
,
{
total
:.
4
f
}
M elements."
)
print_func
(
f
"Total parameters:
{
num_params
}
,
{
total
:.
2
f
}
M elements."
)
def
gradient_norm
(
layer
:
nn
.
Layer
):
...
...
examples/tiny/s1/local/export.sh
浏览文件 @
497cf4e2
...
...
@@ -5,14 +5,24 @@ if [ $# != 3 ];then
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
\
--device
${
device
}
\
--nproc
${
ngpu
}
\
--config
${
config_path
}
\
--checkpoint_path
${
ckpt_path_prefix
}
\
--export_path
${
jit_model_export_path
}
--export_path
${
jit_model_export_path
}
if
[
$?
-ne
0
]
;
then
...
...
examples/tiny/s1/local/train.sh
浏览文件 @
497cf4e2
...
...
@@ -10,6 +10,7 @@ echo "using $ngpu gpus..."
config_path
=
$1
ckpt_name
=
$2
device
=
gpu
if
[
ngpu
!=
0
]
;
then
device
=
cpu
...
...
examples/tiny/s1/run.sh
浏览文件 @
497cf4e2
...
...
@@ -5,16 +5,16 @@ source path.sh
source
${
MAIN_ROOT
}
/utils/parse_options.sh
||
exit
1
;
# prepare data
bash ./local/data.sh
bash ./local/data.sh
||
exit
-1
# train model, all `ckpt` under `exp` dir
CUDA_VISIBLE_DEVICES
=
0 ./local/train.sh conf/conformer.yaml
test
# test ckpt 1
CUDA_VISIBLE_DEVICES
=
0 ./local/test.sh conf/conformer.yaml exp/test/checkpoints/1
CUDA_VISIBLE_DEVICES
=
0 ./local/train.sh conf/conformer.yaml
test
||
exit
-1
# avg 1 best model
./local/avg.sh exp/test/checkpoints 1
# test ckpt 1
CUDA_VISIBLE_DEVICES
=
0 ./local/test.sh conf/conformer.yaml exp/test/checkpoints/avg_1
||
exit
-1
# export ckpt 1
./local/export.sh conf/conformer.yaml exp/test/checkpoints/1 exp/test/checkpoints/1.jit.model
\ No newline at end of file
CUDA_VISIBLE_DEVICES
=
./local/export.sh conf/conformer.yaml exp/test/checkpoints/avg_1 exp/test/checkpoints/avg_1.jit.model
examples/tiny/s1/train.profile
已删除
100644 → 0
浏览文件 @
f3cecf88
文件已删除
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录