From 52e693394d0db35074a22dbcaccc657130cbea36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Kun=C3=A1k?= <38215643+Adamusen@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:09:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[Fix]=20removeprefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed the use of str.removeprefix() as it was first introduced in python 3.9 --- yolo/model/yolo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yolo/model/yolo.py b/yolo/model/yolo.py index 8d463c1..1252916 100644 --- a/yolo/model/yolo.py +++ b/yolo/model/yolo.py @@ -142,7 +142,7 @@ def save_load_weights(self, weights: Union[Path, OrderedDict]): if weights_key not in weights: #.ckpt weights_key = "model." + model_key if weights_key not in weights: #.pt old - weights_key = model_key.removeprefix("model.") + weights_key = model_key[6:] if weights_key not in weights: error_dict["Not Found"].add(tuple(model_key.split(".")[:-2])) continue