From 37734cc05a393c87994683aaa59588492ae198e9 Mon Sep 17 00:00:00 2001 From: esgomezm <43643518+esgomezm@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:39:23 +0100 Subject: [PATCH] Update _torchscript_model_adapter.py converting the input to the model to float to avoid numpy array errors --- bioimageio/core/model_adapters/_torchscript_model_adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bioimageio/core/model_adapters/_torchscript_model_adapter.py b/bioimageio/core/model_adapters/_torchscript_model_adapter.py index 0e9f3aef..dea6bede 100644 --- a/bioimageio/core/model_adapters/_torchscript_model_adapter.py +++ b/bioimageio/core/model_adapters/_torchscript_model_adapter.py @@ -60,7 +60,7 @@ def forward(self, *batch: Optional[Tensor]) -> List[Optional[Tensor]]: assert torch is not None with torch.no_grad(): torch_tensor = [ - None if b is None else torch.from_numpy(b.data.data).to(self.devices[0]) + None if b is None else torch.from_numpy(b.data.data.astype("float32")).to(self.devices[0]) for b in batch ] _result: Union[ # pyright: ignore[reportUnknownVariableType]