Skip to content

Commit

Permalink
Merge pull request #12 from aritraghsh09/Autocrop-no-gpu
Browse files Browse the repository at this point in the history
Updating autocrop.py so that it can run on CPUs as well
  • Loading branch information
aritraghsh09 authored May 16, 2024
2 parents 0d3f24a + e6b81b7 commit 5409d31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ggt/modules/autocrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
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"))
Expand Down

0 comments on commit 5409d31

Please sign in to comment.