Merge pull request #189 from zhangxu999/master

add reset_default_graph.
This commit is contained in:
nl8590687 2020-05-20 15:05:31 +08:00 committed by GitHub
commit 3ab613de8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 13 deletions

View File

@ -12,6 +12,7 @@ from general_function.file_dict import *
from general_function.gen_func import * from general_function.gen_func import *
# LSTM_CNN # LSTM_CNN
import tensorflow as tf
import keras as kr import keras as kr
import numpy as np import numpy as np
import random import random
@ -322,19 +323,9 @@ class ModelSpeech(): # 语音模型类
r = K.ctc_decode(base_pred, in_len, greedy = True, beam_width=100, top_paths=1) r = K.ctc_decode(base_pred, in_len, greedy = True, beam_width=100, top_paths=1)
#print('r', r) #print('r', r)
r1 = r[0][0].eval(session=tf.Session())
tf.reset_default_graph()
r1 = K.get_value(r[0][0]) return r1[0]
#print('r1', r1)
#r2 = K.get_value(r[1])
#print(r2)
r1=r1[0]
return r1
pass
def RecognizeSpeech(self, wavsignal, fs): def RecognizeSpeech(self, wavsignal, fs):
''' '''