示例#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
示例#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
示例#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))