diff --git a/torchvision/prototype/datasets/_builtin/dtd.py b/torchvision/prototype/datasets/_builtin/dtd.py index 36990e8a21d..fc3ec61efc7 100644 --- a/torchvision/prototype/datasets/_builtin/dtd.py +++ b/torchvision/prototype/datasets/_builtin/dtd.py @@ -72,7 +72,8 @@ def _classify_archive(self, data: Tuple[str, Any]) -> Optional[int]: def _image_key_fn(self, data: Tuple[str, Any]) -> str: path = pathlib.Path(data[0]) - return str(path.relative_to(path.parents[1])) + # The split files contain hardcoded posix paths for the images, e.g. banded/banded_0001.jpg + return str(path.relative_to(path.parents[1]).as_posix()) def _collate_and_decode_sample( self,