Exemple #1
0
    def load_model(path):
        """
        Load an existing keras model (with weights) from HDF5 file.

        :param path: String. The path to the pre-defined model.
        :return: KerasModel.
        """
        def load_func(file_path):
            return models.load_model(file_path)
        keras_model = load_from_file(load_func, path)
        return KerasModel(keras_model)
Exemple #2
0
    def load_weights(self, filepath, by_name=False):

        def load_func(file_path):
            self.model.load_weights(file_path, by_name)
        load_from_file(load_func, filepath)