From 04ed6f2e500cc24988fdfb762c9510f81f1dcecf Mon Sep 17 00:00:00 2001 From: Skillnoob <78843978+Skillnoob@users.noreply.github.com> Date: Mon, 28 Oct 2024 22:47:19 +0100 Subject: [PATCH] Fix EdgeTPU wrong PyTorch device (#17199) Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com> Co-authored-by: Glenn Jocher --- ultralytics/nn/autobackend.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ultralytics/nn/autobackend.py b/ultralytics/nn/autobackend.py index 0dcbb12f..9e6d38b4 100644 --- a/ultralytics/nn/autobackend.py +++ b/ultralytics/nn/autobackend.py @@ -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