Beispiel #1
0
 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
Beispiel #2
0
 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
Beispiel #3
0
 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))