Torchvision1. System information2. Install dependencies3. Install Torchvision3.1. Offline installation3.2, Online Installation3.3. Source code compilation4. Verify installationReferences
sudo apt update
xxxxxxxxxx
sudo 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
xxxxxxxxxx
cd Downloads/
xxxxxxxxxx
sudo pip3 install torchvision-0.20.0a0+afc54f7-cp310-cp310-linux_aarch64.whl
xxxxxxxxxx
sudo 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:
xxxxxxxxxx
https://github.com/pytorch/vision/tree/v0.20.0
Enter the unzipped folder downloaded from github and compile the source code:
xxxxxxxxxx
cd vision-0.20.0
xxxxxxxxxx
sudo python3 setup.py install
xxxxxxxxxx
python3 -c "import torchvision; print(f'Torchvision: {torchvision.__version__}')"