def _load_finetune_model(self, nclasses=2, weights_path=None):
    ' Constructs finetuning model architecture and optionally loads weights\n                :param nclasses: number of classes on which to softmax over\n                :param weights_path: optional filepath from which to try to load weights\n        '
    out = self.model.output
    if (self.pooling is None):
        out = GlobalAveragePooling2D()(out)
    dense = Dense(self.clf_head_dense_dim, activation='relu')(out)
    preds = Dense(nclasses, activation='softmax')(dense)
    finetune_model = Model(inputs=self.model.input, outputs=preds)
    if (weights_path is not None):
        if os.path.isfile(weights_path):
            finetune_model.load_weights(weights_path)
    return finetune_model
Constructs finetuning model architecture and optionally loads weights
:param nclasses: number of classes on which to softmax over
:param weights_path: optional filepath from which to try to load weights
def _load_finetune_model(self, nclasses=2, weights_path=None):
    ' Constructs finetuning model architecture and optionally loads weights\n                :param nclasses: number of classes on which to softmax over\n                :param weights_path: optional filepath from which to try to load weights\n        '
    out = self.model.output
    if (self.pooling is None):
        out = GlobalAveragePooling2D()(out)
    dense = Dense(self.clf_head_dense_dim, activation='relu')(out)
    preds = Dense(nclasses, activation='softmax')(dense)
    finetune_model = Model(inputs=self.model.input, outputs=preds)
    if (weights_path is not None):
        if os.path.isfile(weights_path):
            finetune_model.load_weights(weights_path)
    return finetune_model