Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Deploying YOLOv5-6.0 on Jetson Nano

Tech 1

1. Format SD Card and Flash Image

SD Card Formatting

2. Download PyTorch and Torchvision Packages

Download the appropriate versions of PyTorch and Torchvision for your system from the officila PyTorch website.

3. Set Up Remote Access with MobaXterm

Use MobaXterm for remote control and file transfer to the Jetson Nano. MobaXterm Setup

4. Configure CUDA

Open the bash configuration file:

sudo gedit ~/.bashrc

Add the following lines at the end:

export CUDA_HOME=/usr/local/cuda-10.2
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-10.2/bin:$PATH

Save and exit, then apply the changes and verify the CUDA version:

source ~/.bashrc
nvcc -V

CUDA Configuration

Check the current swap space:

free -h

Initial Swap

Increase swap space by editing the configuration file:

sudo gedit /etc/systemd/nvzramconfig.sh

Change 1024 to 4096, save, and reboot the system:

sudo reboot

Verify the updated swap space:

free -h

Updated Swap

5. Update System and Install Dependencies

Update the system and install necessayr packages:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev
pip3 install --upgrade pip

6. Install PyTorch

Navigate to the directory containing the PyTorch wheel file and install it:

pip install torch-1.8.0-cp36-cp36m-linux_aarch64.whl
sudo apt-get install libjpeg-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev
sudo apt install python3-numpy
pip install Cython
export OPENBLAS_CORETYPE=ARMV8

Verify the installation:

python3
import torch
print(torch.__version__)

7. Install Torchvision

Navigate to the Torchvision directory and install it:

sudo apt-get install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev
export BUILD_VERSION=0.9.0
python3 setup.py install --user

Verify the installation:

python3
import torchvision
print(torchvision.__version__)

8. Install YOLOv5-6.0

Upload the YOLOv5-6.0 files and install the required dependencies:

cd yolov5-6.0
pip install -r requirements.txt

This completes the installation process.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.