def save_model(self, model, modelpath, weightspath): # Convert modelto json model.save_weights(weightspath) model = model.to_json() json_file = open(modelpath, "w+"