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

OSError: ./libdarknet.so #2386

Open
Lepiloff opened this issue Feb 12, 2019 · 4 comments
Open

OSError: ./libdarknet.so #2386

Lepiloff opened this issue Feb 12, 2019 · 4 comments

Comments

@Lepiloff
Copy link

I try to work with Yolo v3 using python script darknet.py
Then I run
python darknet.py

I got
Traceback (most recent call last):
  File "darknet.py", line 122, in <module>
    lib = CDLL("./libdarknet.so", RTLD_GLOBAL)
  File "/home/y700/anaconda3/lib/python3.7/ctypes/__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: ./libdarknet.so: cannot open shared object file: No such file or directory

I found informations about at first need set values LIBSO to 1 and make new make. But nothing change. After I try bash script
LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./uselib data/coco.names cfg/yolov3.cfg yolov3.weights test.mp4
and got
bash: ./uselib: no such file or directory
Help me solve this please!

@Lepiloff
Copy link
Author

I do not know how or why, but after several attempts to do
LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH ./uselib data/coco.names cfg/yolov3.cfg yolov3.weights test.mp4
with responce
bash: ./uselib: no such file or directory
I got libdarknet.so at my root dir. But now new error is occured

Traceback (most recent call last):
  File "darknet.py", line 128, in <module>
    copy_image_from_bytes = lib.copy_image_from_bytes
  File "/usr/lib/python2.7/ctypes/__init__.py", line 379, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 384, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: ./libdarknet.so: undefined symbol: copy_image_from_bytes

@AlexeyAB
Copy link
Owner

@Lepiloff

  1. Download the latest version of Darknet at the new directory.

  2. Set LIBSO=1 in the Makefile

  3. Do these commands:

make clean
make

@Lepiloff
Copy link
Author

Perfect! Thanks, Alex. Could you answer why image dont show? I got this response
Unable to show image: can't concat str to bytes

@mzeimet
Copy link

mzeimet commented May 15, 2019

Perfect! Thanks, Alex. Could you answer why image dont show? I got this response
Unable to show image: can't concat str to bytes

after changing

label = detection[0]

to label = str(detection[0])
it worked for me

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

3 participants