Added "device" parameter to classifier constructor to support cpu-only initialization#41
Added "device" parameter to classifier constructor to support cpu-only initialization#41agentmorris merged 6 commits intomainfrom
Conversation
stefanistrate
left a comment
There was a problem hiding this comment.
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.
speciesnet/classifier.py
Outdated
| elif torch.backends.mps.is_available(): | ||
| self.device = "mps" | ||
| if device is not None: | ||
| print(f"Using caller-supplied device {device}") |
There was a problem hiding this comment.
Can you use logging.info() instead of print(), for consistency across the repo? logging.info() should print to stdout/stderr as well.
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. |
No description provided.