From c59dead9fd7e2742bcfaf29da81050032b54a0ca Mon Sep 17 00:00:00 2001 From: DevTekVE Date: Sun, 29 Dec 2024 17:31:27 +0100 Subject: [PATCH] Fix model_runner output to ensure tensor conversion to NumPy. Updated the `run_model` method to explicitly convert tensor outputs to NumPy arrays using `.numpy()`. This ensures compatibility with downstream processes relying on NumPy array inputs. --- selfdrive/modeld/runners/model_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/modeld/runners/model_runner.py b/selfdrive/modeld/runners/model_runner.py index dcc11257e0..f0f5360cba 100644 --- a/selfdrive/modeld/runners/model_runner.py +++ b/selfdrive/modeld/runners/model_runner.py @@ -72,7 +72,7 @@ class TinyGradRunner(ModelRunner): return self.tensor_inputs def run_model(self, inputs: dict[str, any]) -> np.ndarray: - return self.model_run(**inputs).flatten() + return self.model_run(**inputs).numpy().flatten() class ONNXRunner(ModelRunner):