내 머릿속

[YOLO Project 1] YOLOv5 ROS Install 본문

YOLOv5 with ROS

[YOLO Project 1] YOLOv5 ROS Install

두구궁 2023. 5. 22. 16:21
728x90
반응형
SMALL

1. YOLOv5 Package Install

cd <ros_workspace>/src
git clone https://github.com/mats-robotics/detection_msgs.git
git clone --recurse-submodules https://github.com/mats-robotics/yolov5_ros.git 
cd yolov5_ros/src/yolov5
pip install -r requirements.txt # install the requirements for yolov5

2. Build Package

cd <ros_workspace>
catkin build yolov5_ros # build the ROS package


cd <ros_workspace>/src/yolov5_ros/src
chmod +x detect.py

3. CUDA Install

https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=runfile_local

 

CUDA Toolkit 11.7 Downloads

Get the latest feature updates to NVIDIA's proprietary compute stack.

developer.nvidia.com

3.1 If u fail to install with run file.

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-8-local_11.8.0-520.61.05-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2004-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda

Use deb(local) file to install

 

4. Fix ~/.bashrc

export PATH="/usr/local/cuda-11.3/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-11.3/lib64:$LD_LIBRARY_PATH"

5. Check CUDA Version

-nvcc V

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

6. Nvidia Dirver install

ex) 510

728x90
반응형
LIST