          epoch, warped_B, target_B = next(self.images_B)
  
          loss_A = self.model.autoencoder_A.train_on_batch(warped_A, target_A)
          loss_B = self.model.autoencoder_B.train_on_batch(warped_B, target_B)
          print("[%s] [#%d] loss_A: %f, loss_B: %f"  % (time.strftime("%H:%M:%S"), iter, loss_A, loss_B))
  
          if viewer is not None:
              viewer(self.show_sample(target_A[0:14], target_B[0:14]), "training")
  
      def show_sample(self, test_A, test_B):
 
</s> remove         self.images_A = minibatchAB(fn_A, self.BATCH_SIZE)
        self.images_B = minibatchAB(fn_B, self.BATCH_SIZE)
 </s> add         self.images_A = minibatchAB(fn_A, self.batch_size)
        self.images_B = minibatchAB(fn_B, self.batch_size)
 </s> remove     BATCH_SIZE = 64

    def __init__(self, model, fn_A, fn_B):
 </s> add     def __init__(self, model, fn_A, fn_B, batch_size=64):
        self.batch_size = batch_size
 </s> remove                 trainer.train_one_step(epoch, self.show if save_iteration else None)
 </s> add                 trainer.train_one_step(epoch, self.show if (save_iteration or self.save_now) else None) </s> remove         model = PluginLoader.get_model(variant)(self.arguments.model_dir)
 </s> add         model = PluginLoader.get_model(self.arguments.trainer)(self.arguments.model_dir)
        print("[{0}] [#{1:05d}] loss_A: {2:.5f}, loss_B: {3:.5f}".format(time.strftime("%H:%M:%S"), iter, loss_A, loss_B))

          epoch, warped_B, target_B = next(self.images_B)
  
          loss_A = self.model.autoencoder_A.train_on_batch(warped_A, target_A)
          loss_B = self.model.autoencoder_B.train_on_batch(warped_B, target_B)
        print("[{0}] [#{1:05d}] loss_A: {2:.5f}, loss_B: {3:.5f}".format(time.strftime("%H:%M:%S"), iter, loss_A, loss_B))
  
          if viewer is not None:
              viewer(self.show_sample(target_A[0:14], target_B[0:14]), "training")
  
      def show_sample(self, test_A, test_B):
keep keep keep keep replace keep keep keep keep keep
 added batch-size cli argumet.
neatened up train.py and added LowMem trainer option.
Added save_now/show key to preview. 
lib/ModelAE.py