From 48d7dbdbf949da70162610b71af049c7926b4963 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 11 Jul 2023 16:10:00 +0200 Subject: [PATCH] Fix SAM autodownload to `/weights` (#3655) --- ultralytics/vit/sam/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/vit/sam/build.py b/ultralytics/vit/sam/build.py index b2e0986..73b1a03 100644 --- a/ultralytics/vit/sam/build.py +++ b/ultralytics/vit/sam/build.py @@ -100,7 +100,7 @@ def _build_sam( ) sam.eval() if checkpoint is not None: - attempt_download_asset(checkpoint) + checkpoint = attempt_download_asset(checkpoint) with open(checkpoint, 'rb') as f: state_dict = torch.load(f) sam.load_state_dict(state_dict)