                                            self.model.training_opts,
                                            self.config)
          return generator
  
      def train_one_batch(self, do_preview):
          """ Train a batch """
          logger.trace("Training one step: (side: %s)", self.side)
          batch = self.get_next(do_preview)
          try:
              loss = self.model.predictors[self.side].train_on_batch(*batch)
          except tf_errors.ResourceExhaustedError as err:
              msg = ("You do not have enough GPU memory available to train the selected model at "
                     "the selected settings. You can try a number of things:"
 
</s> remove             loss = self.model.predictors[self.side].train_on_batch(*batch)
 </s> add             loss = self._model.predictors[self._side].train_on_batch(model_inputs, model_targets) </s> remove                                           self.model.training_opts,
                                          self.config)
 </s> add                                           self._model.training_opts,
                                          self._config) </s> remove         snapshot_interval = self.model.training_opts.get("snapshot_interval", 0)
 </s> add         snapshot_interval = self._model.training_opts.get("snapshot_interval", 0) </s> remove         print("[{}] [#{:05d}] {}".format(self.timestamp, self.model.iterations, output), end='\r')
 </s> add         print("[{}] [#{:05d}] {}".format(self._timestamp,
                                         self._model.iterations,
                                         output), end='\r') </s> remove         """ Train a batch """
        logger.trace("Training one step: (iteration: %s)", self.model.iterations)
 </s> add         """ Running training on a batch of images for each side.

        Triggered from the training cycle in :class:`scripts.train.Train`.

        Notes
        -----
        As every iteration is called explicitly, the Parameters defined should always be ``None``
        except on save iterations.

        Parameters
        ----------
        viewer: :func:`scripts.train.Train._show`
            The function that will display the preview image
        timelapse_kwargs: dict
            The keyword arguments for generating time-lapse previews. If a time-lapse preview is
            not required then this should be ``None``. Otherwise all values should be full paths
            the keys being `input_a`, `input_b`, `output`.
        """
        logger.trace("Training one step: (iteration: %s)", self._model.iterations)
    def train_one_batch(self):
        """ Train on a single batch of images for this :class:`Batcher`

        Returns
        -------
        list
            The list of loss values (as ``float``) for this batch
        """
        logger.trace("Training one step: (side: %s)", self._side)
        model_inputs, model_targets = self._get_next()
                                            self.model.training_opts,
                                            self.config)
          return generator
  
    def train_one_batch(self):
        """ Train on a single batch of images for this :class:`Batcher`

        Returns
        -------
        list
            The list of loss values (as ``float``) for this batch
        """
        logger.trace("Training one step: (side: %s)", self._side)
        model_inputs, model_targets = self._get_next()
    def train_one_batch(self):
        """ Train on a single batch of images for this :class:`Batcher`

        Returns
        -------
        list
            The list of loss values (as ``float``) for this batch
        """
        logger.trace("Training one step: (side: %s)", self._side)
        model_inputs, model_targets = self._get_next()
    def train_one_batch(self):
        """ Train on a single batch of images for this :class:`Batcher`

        Returns
        -------
        list
            The list of loss values (as ``float``) for this batch
        """
        logger.trace("Training one step: (side: %s)", self._side)
        model_inputs, model_targets = self._get_next()
    def train_one_batch(self):
        """ Train on a single batch of images for this :class:`Batcher`

        Returns
        -------
        list
            The list of loss values (as ``float``) for this batch
        """
        logger.trace("Training one step: (side: %s)", self._side)
        model_inputs, model_targets = self._get_next()
          try:
              loss = self.model.predictors[self.side].train_on_batch(*batch)
          except tf_errors.ResourceExhaustedError as err:
              msg = ("You do not have enough GPU memory available to train the selected model at "
                     "the selected settings. You can try a number of things:"
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Smart Masks - Training Implementation (#914)

* Smart Masks - Training

- Reinstate smart mask training code
- Reinstate mask_type back to model.config
- change 'replicate_input_mask to 'learn_mask'
- Add learn mask option
- Add mask loading from alignments to plugins.train.trainer
- Add mask_blur and mask threshold options
- _base.py - Pass mask options through training_opts dict
- plugins.train.model - check for mask_type not None for learn_mask and penalized_mask_loss
- Limit alignments loading to just those faces that appear in the training folder
- Raise error if not all training images have an alignment, and alignment file is required
- lib.training_data - Mask generation code
- lib.faces_detect - cv2 dimension stripping bugfix
- Remove cv2 linting code

* Update mask helptext in cli.py

* Fix Warp to Landmarks
Remove SHA1 hashing from training data

* Update mask training config

* Capture missing masks at training init

* lib.image.read_image_batch - Return filenames with batch for ordering

* scripts.train - Documentation

* plugins.train.trainer - documentation

* Ensure backward compatibility.
Fix convert for new predicted masks

* Update removed masks to components for legacy models. 
plugins/train/trainer/_base.py