Skip to content

Commit

Permalink
πŸ› [Fix] removeprefix
Browse files Browse the repository at this point in the history
Removed the use of str.removeprefix() as it was first introduced in python 3.9
  • Loading branch information
Adamusen authored Jan 7, 2025
1 parent 818297a commit 52e6933
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yolo/model/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 52e6933

Please sign in to comment.