diff --git a/casanovo/denovo/model_runner.py b/casanovo/denovo/model_runner.py index cbefd849..7549a7a1 100644 --- a/casanovo/denovo/model_runner.py +++ b/casanovo/denovo/model_runner.py @@ -252,16 +252,13 @@ def initialize_model(self, train: bool) -> None: # otherwise use the provided configuration. device = torch.empty(1).device # Use the default device. try: - self.model = Spec2Pep.load_from_checkpoint( - self.model_filename, - map_location=device, - ) - except RuntimeError: self.model = Spec2Pep.load_from_checkpoint( self.model_filename, map_location=device, **model_params, ) + except RuntimeError: + raise RuntimeError("Mismatching parameters between loaded model and config file") def initialize_data_module( self,