From e3eabd83275cf9dfa2fe4ad1feaecbe66b13fb80 Mon Sep 17 00:00:00 2001 From: IgorTatarnikov Date: Tue, 8 Oct 2024 11:30:51 +0100 Subject: [PATCH] Check if provided model is weights only and work around --- cellfinder/core/classify/classify.py | 8 ++++++++ debug.py | 0 2 files changed, 8 insertions(+) create mode 100644 debug.py diff --git a/cellfinder/core/classify/classify.py b/cellfinder/core/classify/classify.py index ec77190f..e1251d39 100644 --- a/cellfinder/core/classify/classify.py +++ b/cellfinder/core/classify/classify.py @@ -68,6 +68,14 @@ def main( workers=workers, ) + if trained_model and trained_model.suffix == ".h5": + print( + "Weights provided in place of the model, " + "loading weights into default model" + ) + model_weights = trained_model + trained_model = None + model = get_model( existing_model=trained_model, model_weights=model_weights, diff --git a/debug.py b/debug.py new file mode 100644 index 00000000..e69de29b