Darknet: OSError: ./libdarknet.so

Created on 12 Feb 2019  路  4Comments  路  Source: AlexeyAB/darknet

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!

Most helpful comment

@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

All 4 comments

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

@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

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

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
https://github.com/AlexeyAB/darknet/blob/cce34712f6928495f1fbc5d69332162fc23491b9/darknet.py#L391

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cipusha picture Cipusha  路  3Comments

rezaabdullah picture rezaabdullah  路  3Comments

qianyunw picture qianyunw  路  3Comments

HilmiK picture HilmiK  路  3Comments

Jacky3213 picture Jacky3213  路  3Comments