From 82b592192dc1bf5b226f6767f62866e12e3f1b0d Mon Sep 17 00:00:00 2001 From: Robin Cole Date: Fri, 13 Oct 2023 20:37:58 +0100 Subject: [PATCH] Format to float (#1656) --- torchgeo/datasets/oscd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchgeo/datasets/oscd.py b/torchgeo/datasets/oscd.py index 6f5b7003d20..e24fbe4612c 100644 --- a/torchgeo/datasets/oscd.py +++ b/torchgeo/datasets/oscd.py @@ -204,7 +204,7 @@ def _load_image(self, paths: Sequence[str]) -> Tensor: with Image.open(path) as img: images.append(np.array(img)) array: "np.typing.NDArray[np.int_]" = np.stack(images, axis=0).astype(np.int_) - tensor = torch.from_numpy(array) + tensor = torch.from_numpy(array).float() return tensor def _load_target(self, path: str) -> Tensor: