ultralytics 8.3.15 new TPU device-selection ability (#16576)
Co-authored-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com> Co-authored-by: Skillnoob <78843978+Skillnoob@users.noreply.github.com> Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
ccda7ff973
commit
22ebd44f62
4 changed files with 42 additions and 21 deletions
|
|
@ -163,7 +163,7 @@ def select_device(device="", batch=0, newline=False, verbose=True):
|
|||
Note:
|
||||
Sets the 'CUDA_VISIBLE_DEVICES' environment variable for specifying which GPUs to use.
|
||||
"""
|
||||
if isinstance(device, torch.device):
|
||||
if isinstance(device, torch.device) or str(device).startswith("tpu"):
|
||||
return device
|
||||
|
||||
s = f"Ultralytics {__version__} 🚀 Python-{PYTHON_VERSION} torch-{torch.__version__} "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue