Skip to content

Commit

Permalink
fix device selection, increase version (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcakyon authored Nov 27, 2022
1 parent 7838001 commit daeef7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sahi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.11.4"
__version__ = "0.11.5"

from sahi.annotation import BoundingBox, Category, Mask
from sahi.auto_model import AutoDetectionModel
Expand Down
2 changes: 1 addition & 1 deletion sahi/utils/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def select_device(device: str):
"""
if device == "cuda":
device = "cuda:0"
device = str(device).strip().lower().replace("none", "") # to string, 'cuda:0' to '0'
device = str(device).strip().lower().replace("cuda:", "").replace("none", "") # to string, 'cuda:0' to '0'
cpu = device == "cpu"
mps = device == "mps" # Apple Metal Performance Shaders (MPS)
if cpu or mps:
Expand Down

0 comments on commit daeef7e

Please sign in to comment.