Open SarchWu opened 5 years ago
@SarchWu Hi,
Did you compile Darknet with GPU=1 CUDNN=1 LIBSO=1
in the Makefile by using make
?
You can find the simplest Cmake example here to use libdarknet.so
library: https://github.com/stereolabs/zed-yolo/blob/master/zed_cpp_sample/CMakeLists.txt#L28
I have generated darknet.so.
Currently it is libdarknet.so
instead of darknet.so
https://github.com/AlexeyAB/darknet/blob/master/Makefile#L50
yes,i compiled with gpu1,cudnn1,libso1 in the makefile.I forked your project almost in July last year.so might generate darknet.so .I will tried the libdarknet tomorrow.thank you
Hi, just rename darknet.so to libdarknet .so and link with -ldarknet, that works for me.
Make sure libdarknet.so is in a standard libs folder (like /usr/lib on Ubuntu) and call ldconfig so the system can find the lib dynamically.
Cheers, Ralf
Hi, just rename darknet.so to libdarknet .so and link with -ldarknet, that works for me.
Make sure libdarknet.so is in a standard libs folder (like /usr/lib on Ubuntu) and call ldconfig so the system can find the lib dynamically.
Cheers, Ralf
HI,miebecker i tried your method.Now the system could find the lib.But it still not worked for me.The error ./src/cuda.c:36: check_error: Assertion `0' failed still exists.
Is it possible to use libdarknet.so
using gcc?
Is it possible to use
libdarknet.so
using gcc?
I compiled with g++. I copied the libdarknet.so to the directory exe ,and run the program with sudo. So the problem had been solved.
@SarchWu really? Can you show me your project tree structure? I keep failing to compile using g++
@SarchWu really? Can you show me your project tree structure? I keep failing to compile using g++
you mean compiling what? my project or darknet?I compiling darknet using the makefile in the darknet_master.As to my project,i write my cmakelist and link the libdarknet.so. And then copy libdarknet.so in the darknet_master to the exe directory of my project
@SarchWu I mean compiling your project that using libdarknet.so . Can you show me your CMakeLists.txt ? I also having problem building using cmake
@SarchWu I mean compiling your project that using libdarknet.so . Can you show me your CMakeLists.txt ? I also having problem building using cmake
set(darknet_root " root_path_of_libdarknet") add_library(darknet SHARED IMPORTED) set_target_properties(darknet PROPERTIES IMPORTED_LOCATION "${darknet_root}/libdarknet.so") aux_source_directory(. srcs) add_executable(main ${srcs}) target_link_libraries(main darknet)
@SarchWu Thank you! Do you also use the C++ API (https://github.com/AlexeyAB/darknet/blob/master/include/yolo_v2_class.hpp)? Do we also need to copy that header file to our project include directory? Or can we link it directly using cmake? Sorry I'm kinda new in linux
@SarchWu Thank you! Do you also use the C++ API (https://github.com/AlexeyAB/darknet/blob/master/include/yolo_v2_class.hpp)? Do we also need to copy that header file to our project include directory? Or can we link it directly using cmake? Sorry I'm kinda new in linux
just copy the file to your project include directory
@SarchWu Thanks a lot for your help!
Hello,AlexeyAB: I have accomplished my own c++ project which could detect object by including yolov2class.hpp and dll on Windows.Now i want to transfer my code from windows to ubuntu.But im not familiar with linux.I have compiled darknet with cuda and cudnn,also,I have generated darknet.so.When the project tried include darknet.so,it could be included,but when the program init the constructor,ie :detector. It occurs cuda error. ./src/cuda.c:36: check_error: Assertion `0' failed. i'm not sure why could this error occur?Maybe the cmakelist.txt of my project is not correct. so,would you tell me how to write the cmakelist.txt of part about including darknet.so in ? or,it might be the cuda include error in cmakelist.txt? thanks for your help