Skip to content

Commit

Permalink
fixed model compilation in model loading
Browse files Browse the repository at this point in the history
  • Loading branch information
nkempynck committed Jun 21, 2024
1 parent 9f32496 commit df5ec90
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/crested/tl/_crested.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,18 @@ def _initialize_logger(logger_type: str | None, project_name: str, run_name: str

return run, callbacks

def load_model(self, model_path: os.PathLike) -> None:
def load_model(self, model_path: os.PathLike, compile: bool = False) -> None:
"""
Load a (pretrained) model from a file.
Parameters
----------
model_path : os.PathLike
Path to the model file.
compile: bool
Compile model after loading.
"""
self.model = tf.keras.models.load_model(model_path, compile=True)
self.model = tf.keras.models.load_model(model_path, compile=compile)

def fit(
self,
Expand Down

0 comments on commit df5ec90

Please sign in to comment.