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

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

which has been recommended in Jetson Nano Forum.

Although, when I run

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

I faced with this error:

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

As you see it complaining about, 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!


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:


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

Would you mind have a look here 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:)


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 @@
 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)
 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
 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.



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.