throwing error when running Yolo on jetson Nano (cannot open shared object file: No such file or directory)

I am trying to run this Yolo model on Jetson Nano

https://github.com/Alro10/YOLO-darknet-on-Jetson-TX2

I need to run it on live webcam camera(Raspberry PI camera). I have also installed OpenCV on Jetson Nano using this link:

https://github.com/AastaNV/JEP/blob/master/script/install_opencv4.0.0_Nano.sh

which has been recommended in Jetson Nano Forum.

Although, when I run

./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights /dev/video1

I faced with this error:

./darknet: error while loading shared libraries: libopencv_highgui.so.3.3: cannot open shared object file: No such file or directory

As you see it complaining about libopencv_highgui.so.3.3, however, I have installed opencv4.0.0.
I am stuck in solving this problem, could you please someone help me with(I have to also mention that previously before I remove all the OpenCV installed files it was loading the model of the weight successfully but stuck in living the webcam video. for fixing that problem, I removed all the opencv including the opencv4 and the opencv light in Jetson with the hope with compiling the opencv again the missing part between GStreamer and OpenCV get fixed. but I faced this error.

your help is much appreciated!

Hi,

It looks like your darnet app is compiled with OpenCV3.3.

You can update this parameter to the folder of OpenCV4.0 to see if helps:

https://github.com/pjreddie/darknet/blob/master/Makefile#L42

Thanks.

Can you please be more specific, how can I update the parameter to the folder of opencv4?

Would you mind have a look here https://github.com/Alro10/YOLO-darknet-on-Jetson-TX2 and share your idea which part needed to update in order to get it run on Jetson NANO:

1.with the opencv in the jetpack,
2.with opencv4

Your help is appreciated:)

Hi,

Sure. You should be able to link the correct OpenCV with the following update:

My opencv release directory is located at /media/nvidia/EXT4/opencv/opencv-4.0.0/release/.

diff --git a/Makefile b/Makefile
index 63e15e6..ec0bc70 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,13 @@
-GPU=0
-CUDNN=0
-OPENCV=0
+GPU=1
+CUDNN=1
+OPENCV=1
 OPENMP=0
 DEBUG=0
 
 ARCH= -gencode arch=compute_30,code=sm_30 \
       -gencode arch=compute_35,code=sm_35 \
       -gencode arch=compute_50,code=[sm_50,compute_50] \
-      -gencode arch=compute_52,code=[sm_52,compute_52]
+      -gencode arch=compute_53,code=[sm_53,compute_53]
 #      -gencode arch=compute_20,code=[sm_20,sm_21] \ This one is deprecated?
 
 # This is what I use, uncomment if you know your arch and want to specify
@@ -43,7 +43,7 @@ ifeq ($(OPENCV), 1)
 COMMON+= -DOPENCV
 CFLAGS+= -DOPENCV
 LDFLAGS+= `pkg-config --libs opencv` -lstdc++
-COMMON+= `pkg-config --cflags opencv` 
+COMMON+= -I/media/nvidia/EXT4/opencv/opencv-4.0.0/include -L/media/nvidia/EXT4/opencv/opencv-4.0.0/release/lib
 endif
 
 ifeq ($(GPU), 1)

I’m still waiting my OpenCV installation to finish and give it a try.
You can also try it if you have time.

Thanks.

Hi,

Sorry for the late.

Confirmed that I can execute darnet for OpenCV4.0 with the Makefile shared in comment #5.
Please also give it a try.

Thanks.