Open ropinheiro opened 4 years ago
Check your pathings. Adding full path for ./libdarknet.so inside darknet.py might help.
Yeah, that isn't going to work - API change. I created a fork with the minimal changes needed to make it work.
As for the undefined symbol error, try installing libcairo packages. This is what I have installed:
@ropinheiro i met the same problem, did you solve it ?
I'm running Ubuntu (20.04, focal) and just cloned the AlexeyAB's Darnet repository.
I have already installed cmake (3.16.13), OpenCV (4.3.0), CuDNN (7.6.5) and CUDA Compilation Tools (10.1).
I have a NVIDIA GEFORCE GTX 950M.
I successfully built it with cmake as described in the documentation, generating a libdarknet.so, with the Makefile configured this way:
GPU=1 CUDNN=1 CUDNN_HALF=0 OPENCV=1 AVX=0 OPENMP=0 LIBSO=1 ZED_CAMERA=0 ZED_CAMERA_v2_8=0
Now I try to execute it from a Python script, and I'm unable to.
What I tried:
1. Using import in a command line running Python from the same path where libdarknet.so was built:
As you can see, I get "undefined symbol: cairo_tag_end" error.
2. Running a Python script from Spyder:
The script I'm trying to run is this one:
https://github.com/augmentedstartups/YOLOv4-Tutorials/blob/master/3.%20YOLOv4%20Video%20and%20Webcam/darknet_video_mod.py
It appears to correctly import darknet, but then when using the darknet.load_net_custom method, it throws an error:
AttributeError: module 'darknet' has no attribute 'load_net_custom'
I spent some hours researching these problems, with lots of installs and upgrades of packages and libraries, and so far it was not solved.
Nonetheless, I'm able to run the standalone executable. E.g. this works properly:
/darknet detector test ./cfg/coco.data ./cfg/yolov4.cfg ./yolov4.weights
But I would really like to have this working in a Python script. Do you have any hints I could try?
Thank you!