@classmethod
def save_model(cls, model, model_name):
    try:
        model.save(model_name)
    except OSError:
        model_json = model.to_json()
        with open(model_name.replace('.h5', '.json'), 'w') as json_file:
            json_file.write(model_json)
        model.save_weights(model_name)
@classmethod
def save_model(cls, model, model_name):
    try:
        model.save(model_name)
    except OSError:
        model_json = model.to_json()
        with open(model_name.replace('.h5', '.json'), 'w') as json_file:
            json_file.write(model_json)
        model.save_weights(model_name)