未验证 提交 bdad383c 编写于 作者: A Aurelius84 提交者: GitHub

fix test_mobile_net random failed test=develop (#25364)

上级 a3dfff51
...@@ -407,12 +407,14 @@ def create_optimizer(args, parameter_list): ...@@ -407,12 +407,14 @@ def create_optimizer(args, parameter_list):
return optimizer return optimizer
def fake_data_reader(batch_size, lable_size): def fake_data_reader(batch_size, label_size):
local_random = np.random.RandomState(SEED)
def reader(): def reader():
batch_data = [] batch_data = []
while True: while True:
img = np.random.random([3, 224, 224]).astype('float32') img = local_random.random_sample([3, 224, 224]).astype('float32')
label = np.random.randint(0, lable_size, [1]).astype('int64') label = local_random.randint(0, label_size, [1]).astype('int64')
batch_data.append([img, label]) batch_data.append([img, label])
if len(batch_data) == batch_size: if len(batch_data) == batch_size:
yield batch_data yield batch_data
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册