feat: 解决新版tf中ctc_decode后出现大量-1问题

This commit is contained in:
nl 2021-11-03 18:13:15 +08:00
parent 05d97c1c83
commit 160f7f6eed
1 changed files with 4 additions and 1 deletions

View File

@ -347,7 +347,10 @@ class ModelSpeech(): # 语音模型类
else:
r1 = r[0][0].numpy()
#tf.compat.v1.reset_default_graph()
return r1[0]
p = 0
while p < len(r1[0])-1 and r1[0][p] != -1:
p += 1
return r1[0][0:p]
def RecognizeSpeech(self, wavsignal, fs):
'''