Skip to content

Commit

Permalink
调整默认配置
Browse files Browse the repository at this point in the history
  • Loading branch information
nl8590687 committed Jul 15, 2018
1 parent 1188e9d commit 666741a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions SpeechModel24.py
Expand Up @@ -396,8 +396,8 @@ def model(self):

ms = ModelSpeech(datapath)

ms.LoadModel(modelpath + 'm24\\speech_model24_e_0_step_411000.model')
#ms.TrainModel(datapath, epoch = 50, batch_size = 4, save_step = 500)
#ms.LoadModel(modelpath + 'm24/speech_model24_e_0_step_411000.model')
ms.TrainModel(datapath, epoch = 50, batch_size = 16, save_step = 500)
#ms.TestModel(datapath, str_dataset='test', data_count = 128, out_report = True)
#r = ms.RecognizeSpeech_FromFile('E:\\语音数据集\\ST-CMDS-20170001_1-OS\\20170001P00241I0053.wav')
#r = ms.RecognizeSpeech_FromFile('E:\\语音数据集\\ST-CMDS-20170001_1-OS\\20170001P00020I0087.wav')
Expand Down
9 changes: 4 additions & 5 deletions SpeechModel25.py
Expand Up @@ -374,7 +374,7 @@ def model(self):

import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
#进行配置,使用70%的GPU
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.93
Expand Down Expand Up @@ -403,10 +403,9 @@ def model(self):

ms = ModelSpeech(datapath)

# 全场最佳 speech_model25_e_0_step_340000
ms.LoadModel(modelpath + 'm25\\speech_model25_e_0_step_545500.model')
#ms.TrainModel(datapath, epoch = 50, batch_size = 4, save_step = 500)
ms.TestModel(datapath, str_dataset='test', data_count = 128, out_report = True)
#ms.LoadModel(modelpath + 'm25/speech_model25_e_0_step_545500.model')
ms.TrainModel(datapath, epoch = 50, batch_size = 16, save_step = 500)
#ms.TestModel(datapath, str_dataset='test', data_count = 128, out_report = True)
#r = ms.RecognizeSpeech_FromFile('E:\\语音数据集\\ST-CMDS-20170001_1-OS\\20170001P00241I0053.wav')
#r = ms.RecognizeSpeech_FromFile('E:\\语音数据集\\ST-CMDS-20170001_1-OS\\20170001P00020I0087.wav')
#r = ms.RecognizeSpeech_FromFile('E:\\语音数据集\\wav\\train\\A11\\A11_167.WAV')
Expand Down
4 changes: 2 additions & 2 deletions SpeechModel26.py
Expand Up @@ -420,8 +420,8 @@ def model(self):

ms = ModelSpeech(datapath)

#ms.LoadModel(modelpath + 'm26\\speech_model26_e_0_step_221500.model')
#ms.TrainModel(datapath, epoch = 50, batch_size = 4, save_step = 1)
#ms.LoadModel(modelpath + 'm26/speech_model26_e_0_step_397000.model')
ms.TrainModel(datapath, epoch = 50, batch_size = 16, save_step = 500)
#ms.TestModel(datapath, str_dataset='test', data_count = 128, out_report = True)
#r = ms.RecognizeSpeech_FromFile('E:\\语音数据集\\ST-CMDS-20170001_1-OS\\20170001P00241I0053.wav')
#r = ms.RecognizeSpeech_FromFile('E:\\语音数据集\\ST-CMDS-20170001_1-OS\\20170001P00020I0087.wav')
Expand Down
6 changes: 3 additions & 3 deletions test_mspeech.py
Expand Up @@ -12,11 +12,11 @@
from keras.backend.tensorflow_backend import set_session


from SpeechModel24 import ModelSpeech
from SpeechModel25 import ModelSpeech


os.environ["CUDA_VISIBLE_DEVICES"] = "0"
#进行配置,使用70%的GPU
#进行配置,使用90%的GPU
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.9
#config.gpu_options.allow_growth=True #不全部占满显存, 按需分配
Expand Down Expand Up @@ -44,7 +44,7 @@

ms = ModelSpeech(datapath)

ms.LoadModel(modelpath + 'm24\\speech_model24_e_0_step_42500.model')
ms.LoadModel(modelpath + 'm25/speech_model25_e_0_step_42500.model')

ms.TestModel(datapath, str_dataset='test', data_count = 128, out_report = True)

Expand Down
8 changes: 4 additions & 4 deletions train_mspeech.py
Expand Up @@ -12,12 +12,12 @@
from keras.backend.tensorflow_backend import set_session


from SpeechModel24 import ModelSpeech
from SpeechModel25 import ModelSpeech

os.environ["CUDA_VISIBLE_DEVICES"] = "0"
#进行配置,使用70%的GPU
#进行配置,使用95%的GPU
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.9
config.gpu_options.per_process_gpu_memory_fraction = 0.95
#config.gpu_options.allow_growth=True #不全部占满显存, 按需分配
set_session(tf.Session(config=config))

Expand All @@ -44,6 +44,6 @@
ms = ModelSpeech(datapath)

#ms.LoadModel(modelpath + 'speech_model24_e_0_step_327500.model')
ms.TrainModel(datapath, epoch = 50, batch_size = 4, save_step = 500)
ms.TrainModel(datapath, epoch = 50, batch_size = 16, save_step = 500)


0 comments on commit 666741a

Please sign in to comment.