def __init__(self, hyperparams, model, outputs):
        """
        Extract the backbone of a model

        :param hyperparams: The hyperparameters for the model.
        :param model: A keras model.
        :param outputs: A List[str] of layer names, as shown in model.summary().
        """
        super(StartTFFromKerasBackbone, self).__init__(hyperparams)
        assert outputs is not None
        self.outputs = outputs
        layers = [model.get_layer(x).output for x in outputs]
        # Using keras and tf.keras seems to make a difference here. tf.keras does not work.
        self.model = keras.models.Model(inputs=model.inputs,
                                        outputs=layers)
def __init__ ( self , hyperparams , model , outputs ) : super ( StartTFFromKerasBackbone , self ) . __init__ ( hyperparams ) assert outputs is not None self . outputs = outputs layers = [ model . get_layer ( x ) . output for x in outputs ] self . model = keras . models . Model ( inputs = model . inputs , outputs = layers )
Extract the backbone of a model

        :param hyperparams: The hyperparameters for the model.
        :param model: A keras model.
        :param outputs: A List[str] of layer names, as shown in model.summary().