From 5ca2df8a95242a0a77bd69b482961dc43fef1830 Mon Sep 17 00:00:00 2001 From: QingSong Hao <88583602+ytzfhqs@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:22:00 +0800 Subject: [PATCH] Update hub_mixin.py Fix the error caused by pop operation on non-existing key in dict. --- segmentation_models_pytorch/base/hub_mixin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/segmentation_models_pytorch/base/hub_mixin.py b/segmentation_models_pytorch/base/hub_mixin.py index 3840cbad..0e642d2c 100644 --- a/segmentation_models_pytorch/base/hub_mixin.py +++ b/segmentation_models_pytorch/base/hub_mixin.py @@ -120,7 +120,7 @@ def save_pretrained( finally: # delete the additional attributes self._del_attrs(["save_directory", "metrics", "dataset"]) - self._hub_mixin_config.pop("_model_class") + self._hub_mixin_config.pop("_model_class", None) return result