"Warning: The number of the whole data ({}) is smaller than the batch_size ({}), and drop_last is turnning on, so nothing will feed in program, Terminated now. Please reset batch_size to a smaller number or feed more data!"
"Warning: The number of the whole data ({}) is smaller than the batch_size ({}), and drop_last is turnning on, so nothing will feed in program, Terminated now. Please reset batch_size to a smaller number or feed more data!".
.format(len(full_lines),settings.batch_size))
format(len(full_lines),settings.batch_size))
os._exit(1)
os._exit(1)
ifnum_trainers>1andmode=="train":
ifnum_trainers>1andmode=="train":
assertself.shuffle_seedisnotNone,"multiprocess train, shuffle seed must be set!"
assertself.shuffle_seedisnotNone,"multiprocess train, shuffle seed must be set!"
np.random.RandomState(self.shuffle_seed).shuffle(
np.random.RandomState(self.shuffle_seed).shuffle(
full_lines)
full_lines)
elifshuffle:
elifshuffle:
np.random.shuffle(full_lines)
ifnotsettings.enable_ceorsettings.same_feed:
np.random.shuffle(full_lines)
batch_data=[]
batch_data=[]
ifsettings.same_feed:
temp_file=full_lines[0]
print("Same images({},nums:{}) will feed in the net".format(
)==7,"Enable CE: The Metrics should contain train_loss, train_acc1, train_acc5, test_loss, test_acc1, test_acc5, and train_speed"
assertlen(
time_info
)>10,"0~9th batch statistics will drop when doing benchmark or ce, because it might be mixed with startup time, so please make sure training at least 10 batches."