  
      def save_weights(self):
          if self.gpus > 1:
              self.netGA_sm.save_weights(str(self.model_dir / netGAH5))
              self.netGB_sm.save_weights(str(self.model_dir / netGBH5))
          else:
              self.netGA.save_weights(str(self.model_dir / netGAH5))
              self.netGB.save_weights(str(self.model_dir / netGBH5))
 
</s> remove                     print ('no alignment found for {}, skipping'.format(os.path.basename(filename)))
 </s> add                     tqdm.write ('no alignment found for {}, skipping'.format(os.path.basename(filename)))
        model_dir = str(self.model_dir)
        if os.path.isdir(model_dir + "_bk"):
            shutil.rmtree(model_dir + "_bk")
        shutil.move(model_dir,  model_dir + "_bk")
        os.mkdir(model_dir)

  
      def save_weights(self):
        model_dir = str(self.model_dir)
        if os.path.isdir(model_dir + "_bk"):
            shutil.rmtree(model_dir + "_bk")
        shutil.move(model_dir,  model_dir + "_bk")
        os.mkdir(model_dir)
          if self.gpus > 1:
              self.netGA_sm.save_weights(str(self.model_dir / netGAH5))
              self.netGB_sm.save_weights(str(self.model_dir / netGBH5))
          else:
              self.netGA.save_weights(str(self.model_dir / netGAH5))
              self.netGB.save_weights(str(self.model_dir / netGBH5))
keep add keep keep keep keep keep keep
 Model backups before saving (#349)

* Sort images properly (to make the frame range parameter meaningfull)

* Add backup mechanism for model weights.

* Replace 'print' call by 'tqdm.write' call. 
plugins/Model_GAN/Model.py