|
![]() |
Raspberry Pi PyTorch Installation
This labnote was last updated on 12/25/2020 This installation is based on the build described at this website: https://mathinf.com/pytorch/arm64/
System RequirementsRaspberry Pi 3 or 4 Raspberry Pi OS 64 bit Confirm your Raspberry Pi is running the 64 bit version of Raspberry Pi OS command: unname -a aarch64 should be part of the version information This install will not work with the 32 bit version of Raspberry Pi OS Instructions to install the 64bit version of the Raspberry Pi OS can be found here: Raspberry Pi OS 64bit Installation Notes Download PyTorch wheelsDownload both wheels for torch and torchvision Copy the wheel fiels to a directory on the Raspberry Pi (we created and used a directory called PyTorch)
Install the prerequisitessudo apt-get install python3-numpy python3-wheel python3-setuptools python3-future python3-yaml python3-six python3-requests python3-pip python3-pillow sudo apt install libopenblas-dev libblas-dev m4 cmake cython python3-dev sudo apt-get install libopenblas-base libopenmpi-dev
Install the wheel filesChange to wheel directory (cd PyTorch) Run install Sudo pip3 install torch*.whl torchvision*.whl
Test InstallationTest the installation by creating a simple tensor in PyTorch With in Python 3, run the following simple program: import torch x=torch.rand(5,4) print(x)
|
![]() |
|