while data['imgs'][0].shape[0] % batch_size ==0: batch_size = batch_size-1 num_batch = data['imgs'][0].shape[0] // batch_size + 1