                  logger.info("Switching to tensorflow backend.")
                  os.environ["KERAS_BACKEND"] = "tensorflow"
          import keras
          from lib.model.layers import L2_normalize
          if backend == "CPU":
              with keras.backend.tf.device("/cpu:0"):
                  return keras.models.load_model(model, {
 
</s> remove             self.vgg_face = VGGFace(backend=self.args.backend, loglevel=self.args.loglevel)
 </s> add             conf = Config("global", configfile=self.args.configfile)
            allow_growth = (conf.config_dict["allow_growth"] and
                            self.args.backend.lower() == "gpu" and
                            get_backend() == "nvidia")
            self.vgg_face = VGGFace(backend=self.args.backend,
                                    allow_growth=allow_growth,
                                    loglevel=self.args.loglevel) </s> remove     def __init__(self, backend="GPU", loglevel="INFO"):
        logger.debug("Initializing %s: (backend: %s, loglevel: %s)",
                     self.__class__.__name__, backend, loglevel)
 </s> add     def __init__(self, backend="GPU", allow_growth=False, loglevel="INFO"):
        logger.debug("Initializing %s: (backend: %s, allow_growth: %s, loglevel: %s)",
                     self.__class__.__name__, backend, allow_growth, loglevel)
        if allow_growth:
            # TODO This needs to be centralized. Just a hacky fix to read the allow growth config
            # option from the Extraction config file
            logger.info("Enabling Tensorflow 'allow_growth' option")
            import tensorflow as tf
            from keras.backend.tensorflow_backend import set_session
            config = tf.ConfigProto()
            config.gpu_options.allow_growth = True
            config.gpu_options.visible_device_list = "0"
            set_session(tf.Session(config=config))
            logger.debug("Set Tensorflow 'allow_growth' option")

                  logger.info("Switching to tensorflow backend.")
                  os.environ["KERAS_BACKEND"] = "tensorflow"
        if allow_growth:
            # TODO This needs to be centralized. Just a hacky fix to read the allow growth config
            # option from the Extraction config file
            logger.info("Enabling Tensorflow 'allow_growth' option")
            import tensorflow as tf
            from keras.backend.tensorflow_backend import set_session
            config = tf.ConfigProto()
            config.gpu_options.allow_growth = True
            config.gpu_options.visible_device_list = "0"
            set_session(tf.Session(config=config))
            logger.debug("Set Tensorflow 'allow_growth' option")

          import keras
          from lib.model.layers import L2_normalize
          if backend == "CPU":
              with keras.backend.tf.device("/cpu:0"):
                  return keras.models.load_model(model, {
keep add keep keep keep keep keep
 Sort by face - Inherit allow_growth option from extract.ini 
lib/vgg_face2_keras.py