Torchvision1. System information2. Install dependencies3. Install Torchvision3.1. Offline installation3.2, Online Installation3.3. Source code compilation4. Verify installationReferences

sudo apt update
xxxxxxxxxxsudo apt install ninja-build libwebp-dev libjpeg-dev -y
According to the correspondence between PyTorch and Torchvision versions, we need to install v0.20 version of Torchvision
| torch | torchvision | Python |
|---|---|---|
main / nightly | main / nightly | >=3.9, <=3.12 |
2.5 | 0.20 | >=3.9, <=3.12 |
Manually go to the download website to download the latest Torchvision version.
Download URL: https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.20.0a0+afc54f7-cp310-cp310-linux_aarch64.whl
xxxxxxxxxxcd Downloads/
xxxxxxxxxxsudo pip3 install torchvision-0.20.0a0+afc54f7-cp310-cp310-linux_aarch64.whl
xxxxxxxxxxsudo pip3 install https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.20.0a0+afc54f7-cp310-cp310-linux_aarch64.whl
Manually download version v0.20:
xxxxxxxxxxhttps://github.com/pytorch/vision/tree/v0.20.0
Enter the unzipped folder downloaded from github and compile the source code:
xxxxxxxxxxcd vision-0.20.0
xxxxxxxxxxsudo python3 setup.py install
xxxxxxxxxxpython3 -c "import torchvision; print(f'Torchvision: {torchvision.__version__}')"
