Skip to content

Added "device" parameter to classifier constructor to support cpu-only initialization#41

Merged
agentmorris merged 6 commits intomainfrom
cpu-ensemble
Aug 8, 2025
Merged

Added "device" parameter to classifier constructor to support cpu-only initialization#41
agentmorris merged 6 commits intomainfrom
cpu-ensemble

Conversation

@agentmorris
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@stefanistrate stefanistrate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to expose device in the other 2 classes as well (SpeciesNetDetector and SpeciesNet), maybe in a future PR? I don't have an immediate use case, but more control given to the user wouldn't hurt.

elif torch.backends.mps.is_available():
self.device = "mps"
if device is not None:
print(f"Using caller-supplied device {device}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use logging.info() instead of print(), for consistency across the repo? logging.info() should print to stdout/stderr as well.

@agentmorris
Copy link
Collaborator Author

Do we want to expose device in the other 2 classes as well (SpeciesNetDetector and SpeciesNet)...

I added a note about adding this to the detector/ensemble classes to our (internal) SpeciesNet todo list, we can discuss the next time we review that list in more detail. I only have an immediate use case for doing this with the Classifier.

@agentmorris agentmorris merged commit 890533a into main Aug 8, 2025
18 checks passed
@agentmorris agentmorris deleted the cpu-ensemble branch August 8, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants