From 9372bc0148d3901c04dfc8a661aa197b44f8b1ae Mon Sep 17 00:00:00 2001 From: alessandrofelder Date: Thu, 14 Nov 2024 10:08:33 +0000 Subject: [PATCH] ensure trained_model is a Path before calling .suffix --- cellfinder/core/classify/classify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cellfinder/core/classify/classify.py b/cellfinder/core/classify/classify.py index 3908b385..cd847a77 100644 --- a/cellfinder/core/classify/classify.py +++ b/cellfinder/core/classify/classify.py @@ -1,5 +1,6 @@ import os from datetime import datetime +from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Tuple import keras @@ -68,7 +69,7 @@ def main( workers=workers, ) - if trained_model and trained_model.suffix == ".h5": + if trained_model and Path(trained_model).suffix == ".h5": print( "Weights provided in place of the model, " "loading weights into default model."