Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
258307df
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看板
未验证
提交
258307df
编写于
3月 17, 2021
作者:
H
Hui Zhang
提交者:
GitHub
3月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix egs bugs (#552)
* fix egs * fix log
上级
4c8c2178
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
13 addition
and
17 deletion
+13
-17
deepspeech/exps/deepspeech2/model.py
deepspeech/exps/deepspeech2/model.py
+0
-4
deepspeech/modules/loss.py
deepspeech/modules/loss.py
+6
-5
examples/aishell/.gitignore
examples/aishell/.gitignore
+1
-0
examples/aishell/local/infer.sh
examples/aishell/local/infer.sh
+1
-1
examples/aishell/run.sh
examples/aishell/run.sh
+2
-2
examples/librispeech/local/infer.sh
examples/librispeech/local/infer.sh
+1
-1
examples/librispeech/local/train.sh
examples/librispeech/local/train.sh
+1
-1
examples/tiny/local/infer.sh
examples/tiny/local/infer.sh
+1
-1
examples/tiny/local/test.sh
examples/tiny/local/test.sh
+0
-1
examples/tiny/local/train.sh
examples/tiny/local/train.sh
+0
-1
未找到文件。
deepspeech/exps/deepspeech2/model.py
浏览文件 @
258307df
...
...
@@ -63,8 +63,6 @@ class DeepSpeech2Trainer(Trainer):
losses_np
=
{
'train_loss'
:
float
(
loss
),
'train_loss_div_batchsize'
:
float
(
loss
)
/
self
.
config
.
data
.
batch_size
}
msg
=
"Train: Rank: {}, "
.
format
(
dist
.
get_rank
())
msg
+=
"epoch: {}, "
.
format
(
self
.
epoch
)
...
...
@@ -90,8 +88,6 @@ class DeepSpeech2Trainer(Trainer):
loss
=
self
.
model
(
*
batch
)
valid_losses
[
'val_loss'
].
append
(
float
(
loss
))
valid_losses
[
'val_loss_div_batchsize'
].
append
(
float
(
loss
)
/
self
.
config
.
data
.
batch_size
)
# write visual log
valid_losses
=
{
k
:
np
.
mean
(
v
)
for
k
,
v
in
valid_losses
.
items
()}
...
...
deepspeech/modules/loss.py
浏览文件 @
258307df
...
...
@@ -62,14 +62,15 @@ class CTCLoss(nn.Layer):
"""Compute CTC loss.
Args:
logits ([paddle.Tensor]): [
description
]
ys_pad ([paddle.Tensor]): [
description
]
hlens ([paddle.Tensor]): [
description
]
ys_lens ([paddle.Tensor]): [
description
]
logits ([paddle.Tensor]): [
B, Tmax, D
]
ys_pad ([paddle.Tensor]): [
B, Tmax
]
hlens ([paddle.Tensor]): [
B
]
ys_lens ([paddle.Tensor]): [
B
]
Returns:
[paddle.Tensor]: scalar. If reduction is 'none', then (N), where N =
\t
ext{batch size}.
"""
B
=
paddle
.
shape
(
logits
)[
0
]
# warp-ctc need logits, and do softmax on logits by itself
# warp-ctc need activation with shape [T, B, V + 1]
# logits: (B, L, D) -> (L, B, D)
...
...
@@ -78,5 +79,5 @@ class CTCLoss(nn.Layer):
# wenet do batch-size average, deepspeech2 not do this
# Batch-size average
# loss = loss /
paddle.shape(logits)[1]
# loss = loss /
B
return
loss
examples/aishell/.gitignore
浏览文件 @
258307df
...
...
@@ -2,3 +2,4 @@ data
ckpt*
demo_cache
*.log
log
examples/aishell/local/infer.sh
浏览文件 @
258307df
#! /usr/bin/env bash
if
[[
$#
!=
1
]]
;
if
[[
$#
!=
1
]]
;
then
echo
"usage:
$0
ckpt-path"
exit
-1
fi
...
...
examples/aishell/run.sh
浏览文件 @
258307df
...
...
@@ -7,7 +7,7 @@ source path.sh
bash ./local/data.sh
# train model
CUDA_VISIBLE_DEVICES
=
0,1,2,3 bash ./local/train.sh
CUDA_VISIBLE_DEVICES
=
0,1,2,3 bash ./local/train.sh
baseline
# test model
CUDA_VISIBLE_DEVICES
=
0 bash ./local/test.sh
...
...
@@ -16,4 +16,4 @@ CUDA_VISIBLE_DEVICES=0 bash ./local/test.sh
CUDA_VISIBLE_DEVICES
=
0 bash ./local/infer.sh ckpt/checkpoints/step-3284
# export model
bash ./local/export.sh ckpt/checkpoints/step-3284 jit.model
\ No newline at end of file
bash ./local/export.sh ckpt/checkpoints/step-3284 jit.model
examples/librispeech/local/infer.sh
浏览文件 @
258307df
#! /usr/bin/env bash
if
[[
$#
!=
1
]]
;
if
[[
$#
!=
1
]]
;
then
echo
"usage:
$0
ckpt-path"
exit
-1
fi
...
...
examples/librispeech/local/train.sh
浏览文件 @
258307df
...
...
@@ -11,7 +11,7 @@ python3 -u ${BIN_DIR}/train.py \
--device
'gpu'
\
--nproc
${
ngpu
}
\
--config
conf/deepspeech2.yaml
\
--output
ckpt
--output
ckpt
-
${
1
}
if
[
$?
-ne
0
]
;
then
echo
"Failed in training!"
...
...
examples/tiny/local/infer.sh
浏览文件 @
258307df
#! /usr/bin/env bash
if
[[
$#
!=
1
]]
;
if
[[
$#
!=
1
]]
;
then
echo
"usage:
$0
ckpt-path"
exit
-1
fi
...
...
examples/tiny/local/test.sh
浏览文件 @
258307df
...
...
@@ -6,7 +6,6 @@ if [ $? -ne 0 ]; then
exit
1
fi
CUDA_VISIBLE_DEVICES
=
0
\
python3
-u
${
BIN_DIR
}
/test.py
\
--device
'gpu'
\
--nproc
1
\
...
...
examples/tiny/local/train.sh
浏览文件 @
258307df
...
...
@@ -2,7 +2,6 @@
export
FLAGS_sync_nccl_allreduce
=
0
CUDA_VISIBLE_DEVICES
=
0
\
python3
-u
${
BIN_DIR
}
/train.py
\
--device
'gpu'
\
--nproc
1
\
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录