|
|
@ -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
|
|
|
|