          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),
              end='\r')
  
          if viewer is not None:
              viewer(self.show_sample(target_A[0:14], target_B[0:14]), "training")
  
 
</s> remove         (face_A,face_B) = (hdf['decoder_AH5'], hdf['decoder_BH5']) if not swapped else (hdf['decoder_BH5'], hdf['decoder_AH5'])
 </s> add         serializer = Serializer.get_serializer('json')
        state_fn = ".".join([hdf['state'], serializer.ext]) 
        try:
            with open(str(self.model_dir / state_fn), 'rb') as fp:
                state = serializer.unmarshal(fp.read().decode('utf-8'))
                self._epoch_no = state['epoch_no']
        except IOError as e:
            print('Error loading training info:', e.strerror)
            self._epoch_no = 0
        except JSONDecodeError as e:
            print('Error loading training info:', e.msg)
            self._epoch_no = 0   
        
        (face_A,face_B) = (hdf['decoder_AH5'], hdf['decoder_BH5']) if not swapped else (hdf['decoder_BH5'], hdf['decoder_AH5'])                
 </s> remove        'decoder_BH5': 'decoder_B.h5'}
 </s> add        'decoder_BH5': 'decoder_B.h5',
       'state': 'state'}

        
        self.model._epoch_no += 1
        
        print("[{0}] [#{1:05d}] loss_A: {2:.5f}, loss_B: {3:.5f}".format(time.strftime("%H:%M:%S"), self.model.epoch_no, 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)
        
        self.model._epoch_no += 1
        
        print("[{0}] [#{1:05d}] loss_A: {2:.5f}, loss_B: {3:.5f}".format(time.strftime("%H:%M:%S"), self.model.epoch_no, loss_A, loss_B),
              end='\r')
  
          if viewer is not None:
              viewer(self.show_sample(target_A[0:14], target_B[0:14]), "training")
  
keep keep keep keep replace keep keep keep keep keep
 - added saving of current epoch number during save_weights (#468) 
plugins/Model_Original/Trainer.py