  
      def save_weights(self):
          self.encoder.save_weights(str(self.model_dir / encoderH5))
          self.decoder_A.save_weights(str(self.model_dir / decoder_AH5))
          self.decoder_B.save_weights(str(self.model_dir / decoder_BH5))
          print('saved model weights')
 
</s>
        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)
          self.encoder.save_weights(str(self.model_dir / encoderH5))
          self.decoder_A.save_weights(str(self.model_dir / decoder_AH5))
          self.decoder_B.save_weights(str(self.model_dir / decoder_BH5))
          print('saved model weights')
keep add 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_Original/AutoEncoder.py