From 54dec26676e33213d8b29b708295fec465b7f3bb Mon Sep 17 00:00:00 2001 From: Aritra Ghosh Date: Wed, 15 May 2024 20:50:46 -0700 Subject: [PATCH 1/2] Update autocrop.py --- ggt/modules/autocrop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggt/modules/autocrop.py b/ggt/modules/autocrop.py index ae5f3857bc..5ea603f088 100644 --- a/ggt/modules/autocrop.py +++ b/ggt/modules/autocrop.py @@ -90,7 +90,7 @@ def main( model = model.to(device) # Load the model from a saved state if provided - model.load_state_dict(torch.load(model_path)) + model.load_state_dict(torch.load(model_path,map_location=torch.device(device))) # Collect all images, then iterate images = glob.glob(str(Path(image_dir) / "*.fits")) From 6470f0411354a45affa4682e722465261afd76b8 Mon Sep 17 00:00:00 2001 From: Aritra Ghosh Date: Wed, 15 May 2024 20:55:16 -0700 Subject: [PATCH 2/2] Update autocrop.py --- ggt/modules/autocrop.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ggt/modules/autocrop.py b/ggt/modules/autocrop.py index 5ea603f088..0bd7fd1a57 100644 --- a/ggt/modules/autocrop.py +++ b/ggt/modules/autocrop.py @@ -90,7 +90,8 @@ def main( model = model.to(device) # Load the model from a saved state if provided - model.load_state_dict(torch.load(model_path,map_location=torch.device(device))) + model.load_state_dict(torch.load(model_path, + map_location=torch.device(device))) # Collect all images, then iterate images = glob.glob(str(Path(image_dir) / "*.fits"))