Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
02083cdb
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,发现更多精彩内容 >>
提交
02083cdb
编写于
11月 01, 2021
作者:
H
huangyuxin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the bug of 'dev/null' and the test_export
上级
fc8a7a15
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
12 deletion
+17
-12
deepspeech/exps/deepspeech2/model.py
deepspeech/exps/deepspeech2/model.py
+5
-5
deepspeech/training/trainer.py
deepspeech/training/trainer.py
+10
-5
examples/aishell/s0/local/test.sh
examples/aishell/s0/local/test.sh
+1
-1
examples/aishell/s0/local/test_export.sh
examples/aishell/s0/local/test_export.sh
+1
-1
未找到文件。
deepspeech/exps/deepspeech2/model.py
浏览文件 @
02083cdb
...
@@ -21,11 +21,6 @@ from typing import Optional
...
@@ -21,11 +21,6 @@ from typing import Optional
import
jsonlines
import
jsonlines
import
numpy
as
np
import
numpy
as
np
import
paddle
import
paddle
from
paddle
import
distributed
as
dist
from
paddle
import
inference
from
paddle.io
import
DataLoader
from
yacs.config
import
CfgNode
from
deepspeech.frontend.featurizer.text_featurizer
import
TextFeaturizer
from
deepspeech.frontend.featurizer.text_featurizer
import
TextFeaturizer
from
deepspeech.io.collator
import
SpeechCollator
from
deepspeech.io.collator
import
SpeechCollator
from
deepspeech.io.dataset
import
ManifestDataset
from
deepspeech.io.dataset
import
ManifestDataset
...
@@ -44,6 +39,10 @@ from deepspeech.utils import mp_tools
...
@@ -44,6 +39,10 @@ from deepspeech.utils import mp_tools
from
deepspeech.utils.log
import
Autolog
from
deepspeech.utils.log
import
Autolog
from
deepspeech.utils.log
import
Log
from
deepspeech.utils.log
import
Log
from
deepspeech.utils.utility
import
UpdateConfig
from
deepspeech.utils.utility
import
UpdateConfig
from
paddle
import
distributed
as
dist
from
paddle
import
inference
from
paddle.io
import
DataLoader
from
yacs.config
import
CfgNode
logger
=
Log
(
__name__
).
getlog
()
logger
=
Log
(
__name__
).
getlog
()
...
@@ -412,6 +411,7 @@ class DeepSpeech2Tester(DeepSpeech2Trainer):
...
@@ -412,6 +411,7 @@ class DeepSpeech2Tester(DeepSpeech2Trainer):
class
DeepSpeech2ExportTester
(
DeepSpeech2Tester
):
class
DeepSpeech2ExportTester
(
DeepSpeech2Tester
):
def
__init__
(
self
,
config
,
args
):
def
__init__
(
self
,
config
,
args
):
super
().
__init__
(
config
,
args
)
super
().
__init__
(
config
,
args
)
self
.
apply_static
=
True
def
compute_result_transcripts
(
self
,
audio
,
audio_len
,
vocab_list
,
cfg
):
def
compute_result_transcripts
(
self
,
audio
,
audio_len
,
vocab_list
,
cfg
):
if
self
.
args
.
model_type
==
"online"
:
if
self
.
args
.
model_type
==
"online"
:
...
...
deepspeech/training/trainer.py
浏览文件 @
02083cdb
...
@@ -18,9 +18,6 @@ from contextlib import contextmanager
...
@@ -18,9 +18,6 @@ from contextlib import contextmanager
from
pathlib
import
Path
from
pathlib
import
Path
import
paddle
import
paddle
from
paddle
import
distributed
as
dist
from
tensorboardX
import
SummaryWriter
from
deepspeech.training.reporter
import
ObsScope
from
deepspeech.training.reporter
import
ObsScope
from
deepspeech.training.reporter
import
report
from
deepspeech.training.reporter
import
report
from
deepspeech.training.timer
import
Timer
from
deepspeech.training.timer
import
Timer
...
@@ -31,6 +28,8 @@ from deepspeech.utils.log import Log
...
@@ -31,6 +28,8 @@ from deepspeech.utils.log import Log
from
deepspeech.utils.utility
import
all_version
from
deepspeech.utils.utility
import
all_version
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
from
paddle
import
distributed
as
dist
from
tensorboardX
import
SummaryWriter
__all__
=
[
"Trainer"
]
__all__
=
[
"Trainer"
]
...
@@ -348,8 +347,12 @@ class Trainer():
...
@@ -348,8 +347,12 @@ class Trainer():
try
:
try
:
with
Timer
(
"Test/Decode Done: {}"
):
with
Timer
(
"Test/Decode Done: {}"
):
with
self
.
eval
():
with
self
.
eval
():
self
.
restore
()
if
hasattr
(
self
,
self
.
test
()
"apply_static"
)
and
self
.
apply_static
is
True
:
self
.
test
()
else
:
self
.
restore
()
self
.
test
()
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
exit
(
-
1
)
exit
(
-
1
)
...
@@ -381,6 +384,8 @@ class Trainer():
...
@@ -381,6 +384,8 @@ class Trainer():
elif
self
.
args
.
checkpoint_path
:
elif
self
.
args
.
checkpoint_path
:
output_dir
=
Path
(
output_dir
=
Path
(
self
.
args
.
checkpoint_path
).
expanduser
().
parent
.
parent
self
.
args
.
checkpoint_path
).
expanduser
().
parent
.
parent
elif
self
.
args
.
export_path
:
output_dir
=
Path
(
self
.
args
.
export_path
).
expanduser
().
parent
.
parent
self
.
output_dir
=
output_dir
self
.
output_dir
=
output_dir
self
.
output_dir
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
self
.
output_dir
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
...
...
examples/aishell/s0/local/test.sh
浏览文件 @
02083cdb
...
@@ -13,7 +13,7 @@ ckpt_prefix=$2
...
@@ -13,7 +13,7 @@ ckpt_prefix=$2
model_type
=
$3
model_type
=
$3
# download language model
# download language model
bash
local
/download_lm_ch.sh
>
dev/null 2>&1
bash
local
/download_lm_ch.sh
>
/
dev/null 2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
exit
1
exit
1
fi
fi
...
...
examples/aishell/s0/local/test_export.sh
浏览文件 @
02083cdb
...
@@ -13,7 +13,7 @@ jit_model_export_path=$2
...
@@ -13,7 +13,7 @@ jit_model_export_path=$2
model_type
=
$3
model_type
=
$3
# download language model
# download language model
bash
local
/download_lm_ch.sh
>
dev/null 2>&1
bash
local
/download_lm_ch.sh
>
/
dev/null 2>&1
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
exit
1
exit
1
fi
fi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录