@classmethod
def load_model(cls, model_name):
    if os.path.exists(model_name.replace('.h5', '.json')):
        json_file = open(model_name.replace('.h5', '.json'), 'r')
        loaded_model_json = json_file.read()
        json_file.close()
        loaded_model = keras.models.model_from_json(loaded_model_json)
        loaded_model.load_weights(model_name)
        return loaded_model
    else:
        return keras.models.load_model(model_name)
@classmethod
def load_model(cls, model_name):
    if os.path.exists(model_name.replace('.h5', '.json')):
        json_file = open(model_name.replace('.h5', '.json'), 'r')
        loaded_model_json = json_file.read()
        json_file.close()
        loaded_model = keras.models.model_from_json(loaded_model_json)
        loaded_model.load_weights(model_name)
        return loaded_model
    else:
        return keras.models.load_model(model_name)