Fix EdgeTPU wrong PyTorch device (#17199)

Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Skillnoob 2024-10-28 22:47:19 +01:00 committed by GitHub
parent aa463705f4
commit 04ed6f2e50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -345,6 +345,7 @@ class AutoBackend(nn.Module):
model_path=w,
experimental_delegates=[load_delegate(delegate, options={"device": device})],
)
device = "cpu" # Required, otherwise PyTorch will try to use the wrong device
else: # TFLite
LOGGER.info(f"Loading {w} for TensorFlow Lite inference...")
interpreter = Interpreter(model_path=w) # load TFLite model