Skip to content
Snippets Groups Projects

Resolve "Update custom_objects to reload models"

Merged Ghost User requested to merge lukas_issue072_feat_custom-objects into develop
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
@@ -17,6 +17,7 @@ from src.data_handling.bootstraps import BootStraps
@@ -17,6 +17,7 @@ from src.data_handling.bootstraps import BootStraps
from src.datastore import NameNotFoundInDataStore
from src.datastore import NameNotFoundInDataStore
from src.helpers import TimeTracking
from src.helpers import TimeTracking
from src.model_modules.linear_model import OrdinaryLeastSquaredModel
from src.model_modules.linear_model import OrdinaryLeastSquaredModel
 
from src.model_modules.model_class import AbstractModelClass
from src.plotting.postprocessing_plotting import PlotMonthlySummary, PlotStationMap, PlotClimatologicalSkillScore, \
from src.plotting.postprocessing_plotting import PlotMonthlySummary, PlotStationMap, PlotClimatologicalSkillScore, \
PlotCompetitiveSkillScore, PlotTimeSeries, PlotBootstrapSkillScore
PlotCompetitiveSkillScore, PlotTimeSeries, PlotBootstrapSkillScore
from src.plotting.postprocessing_plotting import plot_conditional_quantiles
from src.plotting.postprocessing_plotting import plot_conditional_quantiles
@@ -117,7 +118,8 @@ class PostProcessing(RunEnvironment):
@@ -117,7 +118,8 @@ class PostProcessing(RunEnvironment):
except NameNotFoundInDataStore:
except NameNotFoundInDataStore:
logging.info("no model saved in data store. trying to load model from experiment path")
logging.info("no model saved in data store. trying to load model from experiment path")
model_name = self.data_store.get("model_name", "general.model")
model_name = self.data_store.get("model_name", "general.model")
model = keras.models.load_model(model_name)
model_class: AbstractModelClass = self.data_store.get("model", "general.model")
 
model = keras.models.load_model(model_name, custom_objects=model_class.custom_objects)
return model
return model
def plot(self):
def plot(self):
Loading