YOLO environment construction1. System Information2. Preliminary preparation3. Install Ultralytics4. Configure GPU acceleration4. Verify the installationCommon errorsCannot uninstall sympyError phenomenonSolutionCSI camera cannot be calledVerify the environmentReferences
sudo apt update
sudo apt install python3-pip -y
sudo pip install -U pip
xxxxxxxxxx
sudo pip3 install ultralytics[export]
xxxxxxxxxx
sudo reboot
Since we have already installed torch 2.5.0 and torchvision 0.20 in the previous tutorial, there is no need to run the torch and torchvision installation commands here, only the other software packages need to be installed.
torch
xxxxxxxxxx
sudo pip3 install https://github.com/ultralytics/assets/releases/download/v0.0.0/torch-2.5.0a0+872d972e41.nv24.08-cp310-cp310-linux_aarch64.whl
torchvision
xxxxxxxxxx
sudo pip3 install https://github.com/ultralytics/assets/releases/download/v0.0.0/torchvision-0.20.0a0+afc54f7-cp310-cp310-linux_aarch64.whl
cuSPARSELt
xxxxxxxxxx
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/arm64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get -y install libcusparselt0 libcusparselt-dev
onnxruntime-gpu
xxxxxxxxxx
sudo pip3 install https://github.com/ultralytics/assets/releases/download/v0.0.0/onnxruntime_gpu-1.20.0-cp310-cp310-linux_aarch64.whl
Note: Using onnxruntime-gpu requires installing a specific version of numpy. If it is not 1.23.5, you can run the following command to install the specified version
xxxxxxxxxx
sudo pip3 install numpy==1.23.5
Validating Ultralytics
xxxxxxxxxx
python3 -c "import ultralytics; print(ultralytics.__version__)"
Verifying Torch
xxxxxxxxxx
python3 -c "import torch; print(torch.__version__); print(torch.cuda.is_available())"
Verifying Torchvision
xxxxxxxxxx
python3 -c "import torchvision; print(torchvision.__version__)"
Verify Numpy
xxxxxxxxxx
python3 -c "import numpy; print(numpy.__version__)"
Note: The ultralytics version will be updated later, please refer to the version information queried in the system
Cannot uninstall sympy
Uninstall python3-sympy: Reinstall PyTorch after uninstallation
xxxxxxxxxx
sudo apt remove python3-sympy -y
Compile OpenCV from source code and enable GStreamer support: basically the entire process is automatically installed. It is recommended to uninstall the old version and install the new version (the script automatically enables CUDA and GStreamer functions)
xxxxxxxxxx
git clone https://github.com/AastaNV/JEP.git
cd JEP/script
bash install_opencv4.10.0_Jetpack6.1.sh
xxxxxxxxxx
python3 -c "import cv2; print(cv2.getBuildInformation())" | grep GStreamer
python3 -c "import ultralytics; print(ultralytics.__version__)"
python3 -c "import torch; print(torch.__version__); print(torch.cuda.is_available())"
python3 -c "import torchvision; print(torchvision.__version__)"
python3 -c "import numpy; print(numpy.__version__)"
jtop