diff --git a/torchvision/prototype/datasets/_builtin/cub200.py b/torchvision/prototype/datasets/_builtin/cub200.py index c07166a960c..f1531615c23 100644 --- a/torchvision/prototype/datasets/_builtin/cub200.py +++ b/torchvision/prototype/datasets/_builtin/cub200.py @@ -177,7 +177,10 @@ def _prepare_sample( return dict( prepare_ann_fn(anns_data, image.image_size), image=image, - label=Label(int(pathlib.Path(path).parent.name.rsplit(".", 1)[0]), categories=self._categories), + label=Label( + int(pathlib.Path(path).parent.name.rsplit(".", 1)[0]) - 1, + categories=self._categories, + ), ) def _datapipe(self, resource_dps: List[IterDataPipe]) -> IterDataPipe[Dict[str, Any]]: