Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
054e099b
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
054e099b
编写于
9月 17, 2021
作者:
H
Hui Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
format
上级
0e91d26a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
17 deletion
+24
-17
deepspeech/exps/deepspeech2/model.py
deepspeech/exps/deepspeech2/model.py
+2
-2
deepspeech/exps/u2/model.py
deepspeech/exps/u2/model.py
+10
-6
deepspeech/training/extensions/evaluator.py
deepspeech/training/extensions/evaluator.py
+1
-1
deepspeech/training/trainer.py
deepspeech/training/trainer.py
+11
-8
未找到文件。
deepspeech/exps/deepspeech2/model.py
浏览文件 @
054e099b
...
@@ -35,8 +35,8 @@ from deepspeech.models.ds2 import DeepSpeech2Model
...
@@ -35,8 +35,8 @@ from deepspeech.models.ds2 import DeepSpeech2Model
from
deepspeech.models.ds2_online
import
DeepSpeech2InferModelOnline
from
deepspeech.models.ds2_online
import
DeepSpeech2InferModelOnline
from
deepspeech.models.ds2_online
import
DeepSpeech2ModelOnline
from
deepspeech.models.ds2_online
import
DeepSpeech2ModelOnline
from
deepspeech.training.gradclip
import
ClipGradByGlobalNormWithLog
from
deepspeech.training.gradclip
import
ClipGradByGlobalNormWithLog
from
deepspeech.training.trainer
import
Trainer
from
deepspeech.training.reporter
import
report
from
deepspeech.training.reporter
import
report
from
deepspeech.training.trainer
import
Trainer
from
deepspeech.utils
import
error_rate
from
deepspeech.utils
import
error_rate
from
deepspeech.utils
import
layer_tools
from
deepspeech.utils
import
layer_tools
from
deepspeech.utils
import
mp_tools
from
deepspeech.utils
import
mp_tools
...
@@ -108,7 +108,7 @@ class DeepSpeech2Trainer(Trainer):
...
@@ -108,7 +108,7 @@ class DeepSpeech2Trainer(Trainer):
report
(
"batch_size"
,
batch_size
)
report
(
"batch_size"
,
batch_size
)
report
(
"accum"
,
accum_grad
)
report
(
"accum"
,
accum_grad
)
report
(
"step_cost"
,
iteration_time
)
report
(
"step_cost"
,
iteration_time
)
if
dist
.
get_rank
()
==
0
and
self
.
visualizer
:
if
dist
.
get_rank
()
==
0
and
self
.
visualizer
:
for
k
,
v
in
losses_np
.
items
():
for
k
,
v
in
losses_np
.
items
():
# `step -1` since we update `step` after optimizer.step().
# `step -1` since we update `step` after optimizer.step().
...
...
deepspeech/exps/u2/model.py
浏览文件 @
054e099b
...
@@ -34,11 +34,11 @@ from deepspeech.io.sampler import SortagradBatchSampler
...
@@ -34,11 +34,11 @@ from deepspeech.io.sampler import SortagradBatchSampler
from
deepspeech.io.sampler
import
SortagradDistributedBatchSampler
from
deepspeech.io.sampler
import
SortagradDistributedBatchSampler
from
deepspeech.models.u2
import
U2Model
from
deepspeech.models.u2
import
U2Model
from
deepspeech.training.optimizer
import
OptimizerFactory
from
deepspeech.training.optimizer
import
OptimizerFactory
from
deepspeech.training.reporter
import
ObsScope
from
deepspeech.training.reporter
import
report
from
deepspeech.training.scheduler
import
LRSchedulerFactory
from
deepspeech.training.scheduler
import
LRSchedulerFactory
from
deepspeech.training.timer
import
Timer
from
deepspeech.training.timer
import
Timer
from
deepspeech.training.trainer
import
Trainer
from
deepspeech.training.trainer
import
Trainer
from
deepspeech.training.reporter
import
report
from
deepspeech.training.reporter
import
ObsScope
from
deepspeech.utils
import
ctc_utils
from
deepspeech.utils
import
ctc_utils
from
deepspeech.utils
import
error_rate
from
deepspeech.utils
import
error_rate
from
deepspeech.utils
import
layer_tools
from
deepspeech.utils
import
layer_tools
...
@@ -207,17 +207,21 @@ class U2Trainer(Trainer):
...
@@ -207,17 +207,21 @@ class U2Trainer(Trainer):
report
(
"Rank"
,
dist
.
get_rank
())
report
(
"Rank"
,
dist
.
get_rank
())
report
(
"epoch"
,
self
.
epoch
)
report
(
"epoch"
,
self
.
epoch
)
report
(
'step'
,
self
.
iteration
)
report
(
'step'
,
self
.
iteration
)
report
(
'step/total'
,
(
batch_index
+
1
)
/
len
(
self
.
train_loader
))
report
(
'step/total'
,
(
batch_index
+
1
)
/
len
(
self
.
train_loader
))
report
(
"lr"
,
self
.
lr_scheduler
())
report
(
"lr"
,
self
.
lr_scheduler
())
self
.
train_batch
(
batch_index
,
batch
,
msg
)
self
.
train_batch
(
batch_index
,
batch
,
msg
)
self
.
after_train_batch
()
self
.
after_train_batch
()
report
(
'reader_cost'
,
dataload_time
)
report
(
'reader_cost'
,
dataload_time
)
observation
[
'batch_cost'
]
=
observation
[
'reader_cost'
]
+
observation
[
'step_cost'
]
observation
[
'batch_cost'
]
=
observation
[
'reader_cost'
]
+
observation
[
'step_cost'
]
observation
[
'samples'
]
=
observation
[
'batch_size'
]
observation
[
'samples'
]
=
observation
[
'batch_size'
]
observation
[
'ips[sent./sec]'
]
=
observation
[
'batch_size'
]
/
observation
[
'batch_cost'
]
observation
[
'ips[sent./sec]'
]
=
observation
[
'batch_size'
]
/
observation
[
'batch_cost'
]
for
k
,
v
in
observation
.
items
():
for
k
,
v
in
observation
.
items
():
msg
+=
f
"
{
k
}
: "
msg
+=
f
"
{
k
}
: "
msg
+=
f
"
{
v
:
>
.
8
f
}
"
if
isinstance
(
v
,
float
)
else
f
"
{
v
}
"
msg
+=
f
"
{
v
:
>
.
8
f
}
"
if
isinstance
(
v
,
float
)
else
f
"
{
v
}
"
msg
+=
","
msg
+=
","
logger
.
info
(
msg
)
logger
.
info
(
msg
)
data_start_time
=
time
.
time
()
data_start_time
=
time
.
time
()
...
...
deepspeech/training/extensions/evaluator.py
浏览文件 @
054e099b
...
@@ -20,8 +20,8 @@ from paddle.nn import Layer
...
@@ -20,8 +20,8 @@ from paddle.nn import Layer
from
.
import
extension
from
.
import
extension
from
..reporter
import
DictSummary
from
..reporter
import
DictSummary
from
..reporter
import
report
from
..reporter
import
ObsScope
from
..reporter
import
ObsScope
from
..reporter
import
report
from
..timer
import
Timer
from
..timer
import
Timer
from
deepspeech.utils.log
import
Log
from
deepspeech.utils.log
import
Log
logger
=
Log
(
__name__
).
getlog
()
logger
=
Log
(
__name__
).
getlog
()
...
...
deepspeech/training/trainer.py
浏览文件 @
054e099b
...
@@ -13,16 +13,16 @@
...
@@ -13,16 +13,16 @@
# limitations under the License.
# limitations under the License.
import
sys
import
sys
import
time
import
time
from
pathlib
import
Path
from
collections
import
OrderedDict
from
collections
import
OrderedDict
from
pathlib
import
Path
import
paddle
import
paddle
from
paddle
import
distributed
as
dist
from
paddle
import
distributed
as
dist
from
tensorboardX
import
SummaryWriter
from
tensorboardX
import
SummaryWriter
from
deepspeech.training.timer
import
Timer
from
deepspeech.training.reporter
import
report
from
deepspeech.training.reporter
import
ObsScope
from
deepspeech.training.reporter
import
ObsScope
from
deepspeech.training.reporter
import
report
from
deepspeech.training.timer
import
Timer
from
deepspeech.utils
import
mp_tools
from
deepspeech.utils
import
mp_tools
from
deepspeech.utils
import
profiler
from
deepspeech.utils
import
profiler
from
deepspeech.utils.checkpoint
import
Checkpoint
from
deepspeech.utils.checkpoint
import
Checkpoint
...
@@ -30,7 +30,6 @@ from deepspeech.utils.log import Log
...
@@ -30,7 +30,6 @@ from deepspeech.utils.log import Log
from
deepspeech.utils.utility
import
seed_all
from
deepspeech.utils.utility
import
seed_all
from
deepspeech.utils.utility
import
UpdateConfig
from
deepspeech.utils.utility
import
UpdateConfig
__all__
=
[
"Trainer"
]
__all__
=
[
"Trainer"
]
logger
=
Log
(
__name__
).
getlog
()
logger
=
Log
(
__name__
).
getlog
()
...
@@ -236,17 +235,21 @@ class Trainer():
...
@@ -236,17 +235,21 @@ class Trainer():
report
(
"Rank"
,
dist
.
get_rank
())
report
(
"Rank"
,
dist
.
get_rank
())
report
(
"epoch"
,
self
.
epoch
)
report
(
"epoch"
,
self
.
epoch
)
report
(
'step'
,
self
.
iteration
)
report
(
'step'
,
self
.
iteration
)
report
(
'step/total'
,
(
batch_index
+
1
)
/
len
(
self
.
train_loader
))
report
(
'step/total'
,
(
batch_index
+
1
)
/
len
(
self
.
train_loader
))
report
(
"lr"
,
self
.
lr_scheduler
())
report
(
"lr"
,
self
.
lr_scheduler
())
self
.
train_batch
(
batch_index
,
batch
,
msg
)
self
.
train_batch
(
batch_index
,
batch
,
msg
)
self
.
after_train_batch
()
self
.
after_train_batch
()
report
(
'reader_cost'
,
dataload_time
)
report
(
'reader_cost'
,
dataload_time
)
observation
[
'batch_cost'
]
=
observation
[
'reader_cost'
]
+
observation
[
'step_cost'
]
observation
[
'batch_cost'
]
=
observation
[
'reader_cost'
]
+
observation
[
'step_cost'
]
observation
[
'samples'
]
=
observation
[
'batch_size'
]
observation
[
'samples'
]
=
observation
[
'batch_size'
]
observation
[
'ips[sent./sec]'
]
=
observation
[
'batch_size'
]
/
observation
[
'batch_cost'
]
observation
[
'ips[sent./sec]'
]
=
observation
[
'batch_size'
]
/
observation
[
'batch_cost'
]
for
k
,
v
in
observation
.
items
():
for
k
,
v
in
observation
.
items
():
msg
+=
f
"
{
k
}
: "
msg
+=
f
"
{
k
}
: "
msg
+=
f
"
{
v
:
>
.
8
f
}
"
if
isinstance
(
v
,
float
)
else
f
"
{
v
}
"
msg
+=
f
"
{
v
:
>
.
8
f
}
"
if
isinstance
(
v
,
float
)
else
f
"
{
v
}
"
msg
+=
","
msg
+=
","
logger
.
info
(
msg
)
logger
.
info
(
msg
)
data_start_time
=
time
.
time
()
data_start_time
=
time
.
time
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录