Skip to content
Snippets Groups Projects
Commit 202af052 authored by v.gramlich1's avatar v.gramlich1
Browse files

Enable loading weights with external_weights when trainable and create model is False

parent a1d4356f
No related branches found
No related tags found
1 merge request!302Draft: Resolve "Class-based Oversampling technique"
Pipeline #81662 failed
...@@ -301,10 +301,15 @@ class PostProcessing(RunEnvironment): ...@@ -301,10 +301,15 @@ class PostProcessing(RunEnvironment):
:return: the model :return: the model
""" """
external_weights = self.data_store.get("external_weights")
try: try:
model = self.data_store.get("best_model") model = self.data_store.get("best_model")
except NameNotFoundInDataStore: except NameNotFoundInDataStore:
logging.info("No model was saved in data store. Try to load model from experiment path.") logging.info("No model was saved in data store. Try to load model from experiment path.")
if external_weights is not None:
logging.info("load model from external_weights path")
model_name = external_weights
else:
model_name = self.data_store.get("model_name", "model") model_name = self.data_store.get("model_name", "model")
model_class: AbstractModelClass = self.data_store.get("model", "model") model_class: AbstractModelClass = self.data_store.get("model", "model")
model = keras.models.load_model(model_name, custom_objects=model_class.custom_objects) model = keras.models.load_model(model_name, custom_objects=model_class.custom_objects)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment