We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Wrong label mapping in vision/torchvision/datasets/flowers102.py
### 🐛 Describe the bug

from line 70 in the file vision/torchvision/datasets/flowers102.py
```
self._labels = []
self._image_files = []
for image_id in image_ids:
    self._labels.append(image_id_to_label[image_id])  # Note: the bug is here, current the labels are ranged from 1 to 102, which should be ranged from 0 to 101, consider to change this line into self._labels.append(image_id_to_label[image_id] - 1) ?
    self._image_files.append(self._images_folder / f"image_{image_id:05d}.jpg")
```

### Versions

PyTorch version: 1.11.0
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.4 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.16.3
Libc version: glibc-2.31

Python version: 3.8.13 (default, Mar 28 2022, 11:38:47)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.4.0-104-generic-x86_64-with-glibc2.17
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090
Nvidia driver version: 510.54
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] advertorch==0.2.3
[pip3] numpy==1.21.2
[pip3] torch==1.11.0
[pip3] torchaudio==0.11.0
[pip3] torchvision==0.7.0
[conda] advertorch                0.2.3                    pypi_0    pypi
[conda] blas                      1.0                         mkl    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
[conda] cudatoolkit               11.3.1               h2bc3f7f_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.4.0           h06a4308_640    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
[conda] mkl-service               2.4.0            py38h7f8727e_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
[conda] mkl_fft                   1.3.1            py38hd3c417c_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
[conda] mkl_random                1.2.2            py38h51133e4_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
[conda] numpy                     1.21.2           py38h20f2e39_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
[conda] numpy-base                1.21.2           py38h79a1101_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
[conda] pytorch                   1.11.0          py3.8_cuda11.3_cudnn8.2.0_0    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.11.0               py38_cu113    pytorch
[conda] torchvision               0.7.0                    pypi_0    pypi

cc @pmeier @YosuaMichael

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `torchvision/datasets/flowers102.py`
Content:
```
1 from pathlib import Path
2 from typing import Any, Tuple, Callable, Optional
3 
4 import PIL.Image
5 
6 from .utils import check_integrity, download_and_extract_archive, download_url, verify_str_arg
7 from .vision import VisionDataset
8 
9 
10 class Flowers102(VisionDataset):
11     """`Oxford 102 Flower <https://www.robots.ox.ac.uk/~vgg/data/flowers/102/>`_ Dataset.
12 
13     .. warning::
14 
15         This class needs `scipy <https://docs.scipy.org/doc/>`_ to load target files from `.mat` format.
16 
17     Oxford 102 Flower is an image classification dataset consisting of 102 flower categories. The
18     flowers were chosen to be flowers commonly occurring in the United Kingdom. Each class consists of
19     between 40 and 258 images.
20 
21     The images have large scale, pose and light variations. In addition, there are categories that
22     have large variations within the category, and several very similar categories.
23 
24     Args:
25         root (string): Root directory of the dataset.
26         split (string, optional): The dataset split, supports ``"train"`` (default), ``"val"``, or ``"test"``.
27         transform (callable, optional): A function/transform that takes in an PIL image and returns a
28             transformed version. E.g, ``transforms.RandomCrop``.
29         target_transform (callable, optional): A function/transform that takes in the target and transforms it.
30         download (bool, optional): If true, downloads the dataset from the internet and
31             puts it in root directory. If dataset is already downloaded, it is not
32             downloaded again.
33     """
34 
35     _download_url_prefix = "https://www.robots.ox.ac.uk/~vgg/data/flowers/102/"
36     _file_dict = {  # filename, md5
37         "image": ("102flowers.tgz", "52808999861908f626f3c1f4e79d11fa"),
38         "label": ("imagelabels.mat", "e0620be6f572b9609742df49c70aed4d"),
39         "setid": ("setid.mat", "a5357ecc9cb78c4bef273ce3793fc85c"),
40     }
41     _splits_map = {"train": "trnid", "val": "valid", "test": "tstid"}
42 
43     def __init__(
44         self,
45         root: str,
46         split: str = "train",
47         transform: Optional[Callable] = None,
48         target_transform: Optional[Callable] = None,
49         download: bool = False,
50     ) -> None:
51         super().__init__(root, transform=transform, target_transform=target_transform)
52         self._split = verify_str_arg(split, "split", ("train", "val", "test"))
53         self._base_folder = Path(self.root) / "flowers-102"
54         self._images_folder = self._base_folder / "jpg"
55 
56         if download:
57             self.download()
58 
59         if not self._check_integrity():
60             raise RuntimeError("Dataset not found or corrupted. You can use download=True to download it")
61 
62         from scipy.io import loadmat
63 
64         set_ids = loadmat(self._base_folder / self._file_dict["setid"][0], squeeze_me=True)
65         image_ids = set_ids[self._splits_map[self._split]].tolist()
66 
67         labels = loadmat(self._base_folder / self._file_dict["label"][0], squeeze_me=True)
68         image_id_to_label = dict(enumerate(labels["labels"].tolist(), 1))
69 
70         self._labels = []
71         self._image_files = []
72         for image_id in image_ids:
73             self._labels.append(image_id_to_label[image_id])
74             self._image_files.append(self._images_folder / f"image_{image_id:05d}.jpg")
75 
76     def __len__(self) -> int:
77         return len(self._image_files)
78 
79     def __getitem__(self, idx) -> Tuple[Any, Any]:
80         image_file, label = self._image_files[idx], self._labels[idx]
81         image = PIL.Image.open(image_file).convert("RGB")
82 
83         if self.transform:
84             image = self.transform(image)
85 
86         if self.target_transform:
87             label = self.target_transform(label)
88 
89         return image, label
90 
91     def extra_repr(self) -> str:
92         return f"split={self._split}"
93 
94     def _check_integrity(self):
95         if not (self._images_folder.exists() and self._images_folder.is_dir()):
96             return False
97 
98         for id in ["label", "setid"]:
99             filename, md5 = self._file_dict[id]
100             if not check_integrity(str(self._base_folder / filename), md5):
101                 return False
102         return True
103 
104     def download(self):
105         if self._check_integrity():
106             return
107         download_and_extract_archive(
108             f"{self._download_url_prefix}{self._file_dict['image'][0]}",
109             str(self._base_folder),
110             md5=self._file_dict["image"][1],
111         )
112         for id in ["label", "setid"]:
113             filename, md5 = self._file_dict[id]
114             download_url(self._download_url_prefix + filename, str(self._base_folder), md5=md5)
115
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/torchvision/datasets/flowers102.py b/torchvision/datasets/flowers102.py
--- a/torchvision/datasets/flowers102.py
+++ b/torchvision/datasets/flowers102.py
@@ -65,7 +65,7 @@
         image_ids = set_ids[self._splits_map[self._split]].tolist()
 
         labels = loadmat(self._base_folder / self._file_dict["label"][0], squeeze_me=True)
-        image_id_to_label = dict(enumerate(labels["labels"].tolist(), 1))
+        image_id_to_label = dict(enumerate((labels["labels"] - 1).tolist(), 1))
 
         self._labels = []
         self._image_files = []

{"golden_diff": "diff --git a/torchvision/datasets/flowers102.py b/torchvision/datasets/flowers102.py\n--- a/torchvision/datasets/flowers102.py\n+++ b/torchvision/datasets/flowers102.py\n@@ -65,7 +65,7 @@\n         image_ids = set_ids[self._splits_map[self._split]].tolist()\n \n         labels = loadmat(self._base_folder / self._file_dict[\"label\"][0], squeeze_me=True)\n-        image_id_to_label = dict(enumerate(labels[\"labels\"].tolist(), 1))\n+        image_id_to_label = dict(enumerate((labels[\"labels\"] - 1).tolist(), 1))\n \n         self._labels = []\n         self._image_files = []\n", "issue": "Wrong label mapping in vision/torchvision/datasets/flowers102.py\n### \ud83d\udc1b Describe the bug\n\nfrom line 70 in the file vision/torchvision/datasets/flowers102.py\r\n```\r\nself._labels = []\r\nself._image_files = []\r\nfor image_id in image_ids:\r\n    self._labels.append(image_id_to_label[image_id])  # Note: the bug is here, current the labels are ranged from 1 to 102, which should be ranged from 0 to 101, consider to change this line into self._labels.append(image_id_to_label[image_id] - 1) ?\r\n    self._image_files.append(self._images_folder / f\"image_{image_id:05d}.jpg\")\r\n```\n\n### Versions\n\nPyTorch version: 1.11.0\r\nIs debug build: False\r\nCUDA used to build PyTorch: 11.3\r\nROCM used to build PyTorch: N/A\r\n\r\nOS: Ubuntu 20.04.4 LTS (x86_64)\r\nGCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0\r\nClang version: Could not collect\r\nCMake version: version 3.16.3\r\nLibc version: glibc-2.31\r\n\r\nPython version: 3.8.13 (default, Mar 28 2022, 11:38:47)  [GCC 7.5.0] (64-bit runtime)\r\nPython platform: Linux-5.4.0-104-generic-x86_64-with-glibc2.17\r\nIs CUDA available: True\r\nCUDA runtime version: Could not collect\r\nGPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090\r\nNvidia driver version: 510.54\r\ncuDNN version: Could not collect\r\nHIP runtime version: N/A\r\nMIOpen runtime version: N/A\r\nIs XNNPACK available: True\r\n\r\nVersions of relevant libraries:\r\n[pip3] advertorch==0.2.3\r\n[pip3] numpy==1.21.2\r\n[pip3] torch==1.11.0\r\n[pip3] torchaudio==0.11.0\r\n[pip3] torchvision==0.7.0\r\n[conda] advertorch                0.2.3                    pypi_0    pypi\r\n[conda] blas                      1.0                         mkl    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free\r\n[conda] cudatoolkit               11.3.1               h2bc3f7f_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main\r\n[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch\r\n[conda] mkl                       2021.4.0           h06a4308_640    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main\r\n[conda] mkl-service               2.4.0            py38h7f8727e_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main\r\n[conda] mkl_fft                   1.3.1            py38hd3c417c_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main\r\n[conda] mkl_random                1.2.2            py38h51133e4_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main\r\n[conda] numpy                     1.21.2           py38h20f2e39_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main\r\n[conda] numpy-base                1.21.2           py38h79a1101_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main\r\n[conda] pytorch                   1.11.0          py3.8_cuda11.3_cudnn8.2.0_0    pytorch\r\n[conda] pytorch-mutex             1.0                        cuda    pytorch\r\n[conda] torchaudio                0.11.0               py38_cu113    pytorch\r\n[conda] torchvision               0.7.0                    pypi_0    pypi\n\ncc @pmeier @YosuaMichael\n", "before_files": [{"content": "from pathlib import Path\nfrom typing import Any, Tuple, Callable, Optional\n\nimport PIL.Image\n\nfrom .utils import check_integrity, download_and_extract_archive, download_url, verify_str_arg\nfrom .vision import VisionDataset\n\n\nclass Flowers102(VisionDataset):\n    \"\"\"`Oxford 102 Flower <https://www.robots.ox.ac.uk/~vgg/data/flowers/102/>`_ Dataset.\n\n    .. warning::\n\n        This class needs `scipy <https://docs.scipy.org/doc/>`_ to load target files from `.mat` format.\n\n    Oxford 102 Flower is an image classification dataset consisting of 102 flower categories. The\n    flowers were chosen to be flowers commonly occurring in the United Kingdom. Each class consists of\n    between 40 and 258 images.\n\n    The images have large scale, pose and light variations. In addition, there are categories that\n    have large variations within the category, and several very similar categories.\n\n    Args:\n        root (string): Root directory of the dataset.\n        split (string, optional): The dataset split, supports ``\"train\"`` (default), ``\"val\"``, or ``\"test\"``.\n        transform (callable, optional): A function/transform that takes in an PIL image and returns a\n            transformed version. E.g, ``transforms.RandomCrop``.\n        target_transform (callable, optional): A function/transform that takes in the target and transforms it.\n        download (bool, optional): If true, downloads the dataset from the internet and\n            puts it in root directory. If dataset is already downloaded, it is not\n            downloaded again.\n    \"\"\"\n\n    _download_url_prefix = \"https://www.robots.ox.ac.uk/~vgg/data/flowers/102/\"\n    _file_dict = {  # filename, md5\n        \"image\": (\"102flowers.tgz\", \"52808999861908f626f3c1f4e79d11fa\"),\n        \"label\": (\"imagelabels.mat\", \"e0620be6f572b9609742df49c70aed4d\"),\n        \"setid\": (\"setid.mat\", \"a5357ecc9cb78c4bef273ce3793fc85c\"),\n    }\n    _splits_map = {\"train\": \"trnid\", \"val\": \"valid\", \"test\": \"tstid\"}\n\n    def __init__(\n        self,\n        root: str,\n        split: str = \"train\",\n        transform: Optional[Callable] = None,\n        target_transform: Optional[Callable] = None,\n        download: bool = False,\n    ) -> None:\n        super().__init__(root, transform=transform, target_transform=target_transform)\n        self._split = verify_str_arg(split, \"split\", (\"train\", \"val\", \"test\"))\n        self._base_folder = Path(self.root) / \"flowers-102\"\n        self._images_folder = self._base_folder / \"jpg\"\n\n        if download:\n            self.download()\n\n        if not self._check_integrity():\n            raise RuntimeError(\"Dataset not found or corrupted. You can use download=True to download it\")\n\n        from scipy.io import loadmat\n\n        set_ids = loadmat(self._base_folder / self._file_dict[\"setid\"][0], squeeze_me=True)\n        image_ids = set_ids[self._splits_map[self._split]].tolist()\n\n        labels = loadmat(self._base_folder / self._file_dict[\"label\"][0], squeeze_me=True)\n        image_id_to_label = dict(enumerate(labels[\"labels\"].tolist(), 1))\n\n        self._labels = []\n        self._image_files = []\n        for image_id in image_ids:\n            self._labels.append(image_id_to_label[image_id])\n            self._image_files.append(self._images_folder / f\"image_{image_id:05d}.jpg\")\n\n    def __len__(self) -> int:\n        return len(self._image_files)\n\n    def __getitem__(self, idx) -> Tuple[Any, Any]:\n        image_file, label = self._image_files[idx], self._labels[idx]\n        image = PIL.Image.open(image_file).convert(\"RGB\")\n\n        if self.transform:\n            image = self.transform(image)\n\n        if self.target_transform:\n            label = self.target_transform(label)\n\n        return image, label\n\n    def extra_repr(self) -> str:\n        return f\"split={self._split}\"\n\n    def _check_integrity(self):\n        if not (self._images_folder.exists() and self._images_folder.is_dir()):\n            return False\n\n        for id in [\"label\", \"setid\"]:\n            filename, md5 = self._file_dict[id]\n            if not check_integrity(str(self._base_folder / filename), md5):\n                return False\n        return True\n\n    def download(self):\n        if self._check_integrity():\n            return\n        download_and_extract_archive(\n            f\"{self._download_url_prefix}{self._file_dict['image'][0]}\",\n            str(self._base_folder),\n            md5=self._file_dict[\"image\"][1],\n        )\n        for id in [\"label\", \"setid\"]:\n            filename, md5 = self._file_dict[id]\n            download_url(self._download_url_prefix + filename, str(self._base_folder), md5=md5)\n", "path": "torchvision/datasets/flowers102.py"}], "after_files": [{"content": "from pathlib import Path\nfrom typing import Any, Tuple, Callable, Optional\n\nimport PIL.Image\n\nfrom .utils import check_integrity, download_and_extract_archive, download_url, verify_str_arg\nfrom .vision import VisionDataset\n\n\nclass Flowers102(VisionDataset):\n    \"\"\"`Oxford 102 Flower <https://www.robots.ox.ac.uk/~vgg/data/flowers/102/>`_ Dataset.\n\n    .. warning::\n\n        This class needs `scipy <https://docs.scipy.org/doc/>`_ to load target files from `.mat` format.\n\n    Oxford 102 Flower is an image classification dataset consisting of 102 flower categories. The\n    flowers were chosen to be flowers commonly occurring in the United Kingdom. Each class consists of\n    between 40 and 258 images.\n\n    The images have large scale, pose and light variations. In addition, there are categories that\n    have large variations within the category, and several very similar categories.\n\n    Args:\n        root (string): Root directory of the dataset.\n        split (string, optional): The dataset split, supports ``\"train\"`` (default), ``\"val\"``, or ``\"test\"``.\n        transform (callable, optional): A function/transform that takes in an PIL image and returns a\n            transformed version. E.g, ``transforms.RandomCrop``.\n        target_transform (callable, optional): A function/transform that takes in the target and transforms it.\n        download (bool, optional): If true, downloads the dataset from the internet and\n            puts it in root directory. If dataset is already downloaded, it is not\n            downloaded again.\n    \"\"\"\n\n    _download_url_prefix = \"https://www.robots.ox.ac.uk/~vgg/data/flowers/102/\"\n    _file_dict = {  # filename, md5\n        \"image\": (\"102flowers.tgz\", \"52808999861908f626f3c1f4e79d11fa\"),\n        \"label\": (\"imagelabels.mat\", \"e0620be6f572b9609742df49c70aed4d\"),\n        \"setid\": (\"setid.mat\", \"a5357ecc9cb78c4bef273ce3793fc85c\"),\n    }\n    _splits_map = {\"train\": \"trnid\", \"val\": \"valid\", \"test\": \"tstid\"}\n\n    def __init__(\n        self,\n        root: str,\n        split: str = \"train\",\n        transform: Optional[Callable] = None,\n        target_transform: Optional[Callable] = None,\n        download: bool = False,\n    ) -> None:\n        super().__init__(root, transform=transform, target_transform=target_transform)\n        self._split = verify_str_arg(split, \"split\", (\"train\", \"val\", \"test\"))\n        self._base_folder = Path(self.root) / \"flowers-102\"\n        self._images_folder = self._base_folder / \"jpg\"\n\n        if download:\n            self.download()\n\n        if not self._check_integrity():\n            raise RuntimeError(\"Dataset not found or corrupted. You can use download=True to download it\")\n\n        from scipy.io import loadmat\n\n        set_ids = loadmat(self._base_folder / self._file_dict[\"setid\"][0], squeeze_me=True)\n        image_ids = set_ids[self._splits_map[self._split]].tolist()\n\n        labels = loadmat(self._base_folder / self._file_dict[\"label\"][0], squeeze_me=True)\n        image_id_to_label = dict(enumerate((labels[\"labels\"] - 1).tolist(), 1))\n\n        self._labels = []\n        self._image_files = []\n        for image_id in image_ids:\n            self._labels.append(image_id_to_label[image_id])\n            self._image_files.append(self._images_folder / f\"image_{image_id:05d}.jpg\")\n\n    def __len__(self) -> int:\n        return len(self._image_files)\n\n    def __getitem__(self, idx) -> Tuple[Any, Any]:\n        image_file, label = self._image_files[idx], self._labels[idx]\n        image = PIL.Image.open(image_file).convert(\"RGB\")\n\n        if self.transform:\n            image = self.transform(image)\n\n        if self.target_transform:\n            label = self.target_transform(label)\n\n        return image, label\n\n    def extra_repr(self) -> str:\n        return f\"split={self._split}\"\n\n    def _check_integrity(self):\n        if not (self._images_folder.exists() and self._images_folder.is_dir()):\n            return False\n\n        for id in [\"label\", \"setid\"]:\n            filename, md5 = self._file_dict[id]\n            if not check_integrity(str(self._base_folder / filename), md5):\n                return False\n        return True\n\n    def download(self):\n        if self._check_integrity():\n            return\n        download_and_extract_archive(\n            f\"{self._download_url_prefix}{self._file_dict['image'][0]}\",\n            str(self._base_folder),\n            md5=self._file_dict[\"image\"][1],\n        )\n        for id in [\"label\", \"setid\"]:\n            filename, md5 = self._file_dict[id]\n            download_url(self._download_url_prefix + filename, str(self._base_folder), md5=md5)\n", "path": "torchvision/datasets/flowers102.py"}]}