From 1188e9d6e7d8e274eff2bd1d4092182dc04dbabf Mon Sep 17 00:00:00 2001 From: nl8590687 <3210346136@qq.com> Date: Mon, 9 Jul 2018 17:50:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=95=B0=E6=8D=AE=E7=9A=84=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E4=BB=A5=E6=8F=90=E9=AB=98=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E6=B3=9B=E5=8C=96=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readdata24.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/readdata24.py b/readdata24.py index 4a820c3..f5318d7 100644 --- a/readdata24.py +++ b/readdata24.py @@ -193,9 +193,11 @@ class DataSpeech(): label_length = [] - ran_num = random.randint(0,self.DataNum - 1) # 获取一个随机数 + for i in range(batch_size): - data_input, data_labels = self.GetData((ran_num + i) % self.DataNum) # 从随机数开始连续向后取一定数量数据 + ran_num = random.randint(0,self.DataNum - 1) # 获取一个随机数 + data_input, data_labels = self.GetData(ran_num) # 通过随机数取一个数据 + #data_input, data_labels = self.GetData((ran_num + i) % self.DataNum) # 从随机数开始连续向后取一定数量数据 input_length.append(data_input.shape[0] // 8 + data_input.shape[0] % 8) #print(data_input, data_labels)