From b47c62a2e07fce5f1a6c1b437097bc859b522de3 Mon Sep 17 00:00:00 2001 From: isaaccorley <22203655+isaaccorley@users.noreply.github.com> Date: Wed, 12 Apr 2023 20:36:47 +0000 Subject: [PATCH] fix listing directories bug x2 --- torchgeo/datasets/seco.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchgeo/datasets/seco.py b/torchgeo/datasets/seco.py index 1c0cbe093f0..45f715b34d7 100644 --- a/torchgeo/datasets/seco.py +++ b/torchgeo/datasets/seco.py @@ -126,7 +126,7 @@ def __getitem__(self, index: int) -> Dict[str, Tensor]: root = os.path.join( self.root, self.metadata[self.version]["directory"], f"{index:06}" ) - subdirs = [f for f in os.listdir(root) if os.path.isdir(f)] + subdirs = [f for f in os.listdir(root) if os.path.isdir(os.path.join(root, f))] subdirs = random.sample(subdirs, self.seasons) images = [self._load_patch(root, subdir) for subdir in subdirs]