          logger.debug("Closed Monitor")
          return err
  
      @staticmethod
      def keypress_monitor(keypress_queue):
          """ Monitor stdin for key press """
          while True:
              keypress_queue.put(sys.stdin.read(1))
  
      @staticmethod
      def set_tf_allow_growth():
          """ Allow TensorFlow to manage VRAM growth """
          # pylint: disable=no-member
 
</s> remove     @staticmethod
    def set_tf_allow_growth():
        """ Allow TensorFlow to manage VRAM growth """
 </s> add         Enables the Tensorflow allow_growth option if requested in the command line arguments
        """ </s> remove                     with self.lock:
                        for name, image in self.preview_buffer.items():
 </s> add                     with self._lock:
                        for name, image in self._preview_buffer.items(): </s> remove     def monitor(self, thread):
        """ Monitor the console, and generate + monitor preview if requested """
        is_preview = self.args.preview
 </s> add     def _monitor(self, thread):
        """ Monitor the background :func:`_training` thread for key presses and errors.

        Returns
        -------
        bool
            ``True`` if there has been an error in the background thread otherwise ``False``
        """
        is_preview = self._args.preview </s> remove         return bool(self.model.state.mask_shapes)
 </s> add         return bool(self.model.state.config.get("learn_mask", False)) </s> remove         self.stop = True
 </s> add         self._stop = True
    def _set_tf_allow_growth():
        """ Allow TensorFlow to manage VRAM growth.
          logger.debug("Closed Monitor")
          return err
  
      @staticmethod
    def _set_tf_allow_growth():
        """ Allow TensorFlow to manage VRAM growth.
    def _set_tf_allow_growth():
        """ Allow TensorFlow to manage VRAM growth.
    def _set_tf_allow_growth():
        """ Allow TensorFlow to manage VRAM growth.
    def _set_tf_allow_growth():
        """ Allow TensorFlow to manage VRAM growth.
  
      @staticmethod
      def set_tf_allow_growth():
          """ Allow TensorFlow to manage VRAM growth """
          # pylint: disable=no-member
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. 
scripts/train.py