Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Darknet Start Problem #382

Closed
tuncaybahadir opened this issue Dec 21, 2017 · 18 comments
Closed

Darknet Start Problem #382

tuncaybahadir opened this issue Dec 21, 2017 · 18 comments

Comments

@tuncaybahadir
Copy link

Hello there,

I am a Ubuntu 16.04 user. I started the system first with OpenCV (2.4.0) and then started the yolo setup with OpenCV support. When I finish the process, I get an error about the following library when I write ./darknet. How can I solve my problem?

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

./darknet detect cfg/yolo.cfg yolo.weights data/dog.jpg ./darknet: error while loading shared libraries: libopencv_highgui.so.3.4: cannot open shared object file: No such file or directory

@guerillagorilla
Copy link

Had the same issue as you on 17.10. After running both below, I was able to run darknet:

  • sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
  • sudo ldconfig

@tuncaybahadir
Copy link
Author

Thank you,
The sudo ldconfig command solved my problem.

@rachana88
Copy link

having this error , please help

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

@kasparov92
Copy link

@rachana88 you shall do the same as @guerillagorilla 's solution but replace the /usr/local/lib with the actual location of where you have installed the opencv

@mouradbelo
Copy link

I have the same problem. I have 4.0 version in /usr/local/lib : libopencv_highgui.so.4.0 but the error is about libopencv_highgui.so.3.3. So even after trying your solution it doesn't work because there isn't the libopencv_highgui.so.3.3 there's only libopencv_highgui.so.4.0.

@ianfhunter
Copy link

I too had this issue but was able to re-install withapt-get install libopencv-highgui-dev

@LinderPi
Copy link

I have the same problem. I have 4.0 version in /usr/local/lib : libopencv_highgui.so.4.0 but the error is about libopencv_highgui.so.3.3. So even after trying your solution it doesn't work because there isn't the libopencv_highgui.so.3.3 there's only libopencv_highgui.so.4.0.

@mouradbelo
How did you fix the problem in the end? I have the same issue and I don't know how to install the older version of that library. Please help!

@mouradbelo
Copy link

@LinderPi

I think you need to update your pkgconfig path file and compile again darknet. I don't have my computer in front of me now, i'll tell you how tomorrow. However if you want to install the old OpenCV library here's the link: https://opencv.org/releases.html.
Download the source code of the 3.3 version, compile then install. Here's a link on how to do this : https://docs.opencv.org/3.4/d7/d9f/tutorial_linux_install.html.
You can use ccmake instead of cmake to list all the options and choose what you want.

Hope this helps !

@barresoft
Copy link

for noobs (me) solution:

Install libs:
sudo apt-get install libopencv-highgui-dev

search for installed file
find /usr | grep libopencv_highgui.so.3.4

@milliema
Copy link

For miniconda/annaconda users, the libopencv_highgui.so.3.2 is located in : miniconda/envs/env_namexxx/lib

@David-Chenn
Copy link

David-Chenn commented Dec 11, 2019

I am a MacOS 10.14 user and opencv-contrib-python version is 4.1.2.30 , I tried to import Darknet on python in terminal the error message was
OSError: libopencv_highgui.so.3.2: cannot open shared object file: No such file or directory
And @guerillagorilla 's solution doent work for me and I have already changed the path into where my libopencv_highgui.so.3.2 is installed
Can anyone help
I tried to find where libopencv_highgui.so.3.2 is installed so I tried
find /usr | grep libopencv_highgui.so.3.2
Then here's the output
/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.3.2
So then I tried
sudo /bin/bash -c 'echo "/usr/lib/x86_64-linux-gnu/" > /etc/ld.so.conf.d/opencv.conf'
(Also I have also tried
sudo /bin/bash -c 'echo "/usr/lib/" > /etc/ld.so.conf.d/opencv.conf')
And
sudo ldconfig
then I got the same error message again

@pullmyleg
Copy link

Thanks to your post fixed a similar issue!

My fix was slightly different and am noting here so I don't forget :). Due to using an Azure Deep Learning Virtual Machine on Ubuntu 18.04 the OpenCV library files we're in the anaconda environment directories.

My error: error while loading shared libraries: libopencv_dnn.so.3.4: cannot open shared object file: No such file or directory

Used similar steps to you:

  1. Searched for file missing sudo find / -name "libopencv_dnn.so.3.4*"
  2. The file was found multiple times. I selected the conda environment I was using. In my case py37_default. I know this environment has all the libraries I required
  3. Created opencv.conf in /etc/ld.so.conf.d
  4. Added the anaconda/enviro/python/lib directory chosen to the opencv.conf file as one line and saved using sudo nano /etc/ld.so.conf.d/opencv.conf
  5. Run this command: sudo ldconfig -v
  6. Everything works as normal.

Note to be safe I also deleted the darknet repo folder and rebuilt using CMake as per readme.

@huynhldvn
Copy link

Had the same issue as you on 17.10. After running both below, I was able to run darknet:

  • sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
  • sudo ldconfig

thank you @guerillagorilla you saved my day ,

@fengzihaoran
Copy link

What about this situation?
./darknet: error while loading shared libraries: libmvec.so.1: cannot open shared object file: No such file or directory

@husseinpasha
Copy link

husseinpasha commented Aug 10, 2020

I hade OpenCV 4.0 and then I removed it and installed OpenCV 3.4 from the source. After that, I got the same issue. I followed the above instructions but none of them worked except reinstalling darknet. After reinstalling darknet the problem was solved.
Ubuntu 18.04
Jetson TX2

@lswgh
Copy link

lswgh commented Oct 30, 2020

using make clean and then make ,it has solved!

@dainv1989
Copy link

using make clean and then make ,it has solved!

it works! you saved my life

@celik02
Copy link

celik02 commented Mar 12, 2022

Thank you, The sudo ldconfig command solved my problem.

Just running the second command was also enough for me. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests