def load(self, path): path += self.file_extension if not os.path.isfile(path): raise LoadModelException( "Loading model failed. File {} not found.".format(path)) try: self.clf = joblib.load(path) except OSError as e: raise LoadModelException( 'Loading model from {} failed'.format(path)) from e
def load(self, path): path += self.file_extension if not os.path.isfile(path): raise LoadModelException( "Loading model failed. File {} not found.".format(path)) with self.tf_graph.as_default(): try: self.model = keras.models.load_model(path) except OSError as e: raise LoadModelException( 'Loading model from {} failed'.format(path)) from e
def check_load(self, path): path += self.file_extension if not os.path.isfile(path): raise LoadModelException( "Loading model failed. File {} not found.".format(path))