Open kidapu opened 6 years ago
yes, sorry, i have the same problems on my side as well. have to rebuild darknet for linux, the library we have now is giving these linker errors. if you manage to get it built on your side, a PR would be very welcome.
@genekogan I cloned latest darknet repository, and build it, and replace ofxDarknet in forked my repository.
https://github.com/kidapu/ofxDarknet/commit/4434d9a3c4199f6e5ae9de42c52ac8eb48e30b52
I encountered many errors, I fixed it as much as possible.
However, I can't understand how to solve the last error.
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o: In function `void std::__insertion_sort<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long> > >, __gnu_cxx::__ops::_Iter_comp_iter<ofxDarknet::yolo(ofPixels_<unsigned char>&, float, float)::{lambda(int, int)#1}> >(__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long> > >, __gnu_cxx::__ops::_Iter_comp_iter<ofxDarknet::yolo(ofPixels_<unsigned char>&, float, float)::{lambda(int, int)#1}>, __gnu_cxx::__ops::_Iter_comp_iter<ofxDarknet::yolo(ofPixels_<unsigned char>&, float, float)::{lambda(int, int)#1}>)':
ofxDarknet.cpp:(.text+0xae): undefined reference to `max_index(float*, int)'
ofxDarknet.cpp:(.text+0xcd): undefined reference to `max_index(float*, int)'
ofxDarknet.cpp:(.text+0x13d): undefined reference to `max_index(float*, int)'
ofxDarknet.cpp:(.text+0x164): undefined reference to `max_index(float*, int)'
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o: In function `void std::__adjust_heap<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long> > >, long, unsigned long, __gnu_cxx::__ops::_Iter_comp_iter<ofxDarknet::yolo(ofPixels_<unsigned char>&, float, float)::{lambda(int, int)#1}> >(__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long> > >, long, __gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long> > >, unsigned long, __gnu_cxx::__ops::_Iter_comp_iter<ofxDarknet::yolo(ofPixels_<unsigned char>&, float, float)::{lambda(int, int)#1}>)':
ofxDarknet.cpp:(.text+0x247): undefined reference to `max_index(float*, int)'
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o:ofxDarknet.cpp:(.text+0x270): more undefined references to `max_index(float*, int)' follow
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o: In function `ofxDarknet::get_network_output_layer_gpu(int)':
ofxDarknet.cpp:(.text+0x9a5): undefined reference to `cuda_pull_array(float*, float*, unsigned long)'
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o: In function `ofxDarknet::nightmare(ofPixels_<unsigned char>&, int, int, int, int, int, int, float, float)':
ofxDarknet.cpp:(.text+0xa54): undefined reference to `make_image(int, int, int)'
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o: In function `ofxDarknet::convert(ofPixels_<unsigned char>&)':
ofxDarknet.cpp:(.text+0xe93): undefined reference to `make_image(int, int, int)'
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o: In function `ofxDarknet::classify(ofPixels_<unsigned char>&, int)':
ofxDarknet.cpp:(.text+0x116a): undefined reference to `make_image(int, int, int)'
ofxDarknet.cpp:(.text+0x125b): undefined reference to `network_predict(network, float*)'
ofxDarknet.cpp:(.text+0x1284): undefined reference to `top_k(float*, int, int, int*)'
ofxDarknet.cpp:(.text+0x14c8): undefined reference to `free_image(image)'
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o: In function `ofxDarknet::getFeatureMaps(int)':
ofxDarknet.cpp:(.text+0x1c41): undefined reference to `cuda_pull_array(float*, float*, unsigned long)'
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o: In function `ofxDarknet::init(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
ofxDarknet.cpp:(.text+0x1fb8): undefined reference to `parse_network_cfg(char*)'
ofxDarknet.cpp:(.text+0x1fd7): undefined reference to `load_weights(network*, char*)'
ofxDarknet.cpp:(.text+0x1fe4): undefined reference to `set_batch_network(network*, int)'
ofxDarknet.cpp:(.text+0x2cce): undefined reference to `get_labels(char*)'
/home/kida/openFrameworks_098/addons/obj/linux64/Release/ofxDarknet/src/ofxDarknet.o: In function `ofxDarknet::yolo(ofPixels_<unsigned char>&, float, float)':
ofxDarknet.cpp:(.text+0x305c): undefined reference to `make_image(int, int, int)'
ofxDarknet.cpp:(.text+0x31e3): undefined reference to `network_predict(network, float*)'
ofxDarknet.cpp:(.text+0x3259): undefined reference to `get_region_boxes(layer, int, int, int, int, float, float**, box*, float**, int, int*, float, int)'
ofxDarknet.cpp:(.text+0x3295): undefined reference to `do_nms_sort(box*, float**, int, int, float)'
ofxDarknet.cpp:(.text+0x32b0): undefined reference to `free_image(image)'
ofxDarknet.cpp:(.text+0x3355): undefined reference to `cuda_pull_array(float*, float*, unsigned long)'
ofxDarknet.cpp:(.text+0x3673): undefined reference to `max_index(float*, int)'
ofxDarknet.cpp:(.text+0x3696): undefined reference to `max_index(float*, int)'
ofxDarknet.cpp:(.text+0x3780): undefined reference to `max_index(float*, int)'
ofxDarknet.cpp:(.text+0x37d4): undefined reference to `get_color(int, int, int)'
ofxDarknet.cpp:(.text+0x37ef): undefined reference to `get_color(int, int, int)'
ofxDarknet.cpp:(.text+0x3807): undefined reference to `get_color(int, int, int)'
ofxDarknet.cpp:(.text+0x4030): undefined reference to `free_ptrs(void**, int)'
collect2: error: ld returned 1 exit status
/home/kida/openFrameworks_098/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:382: recipe for target 'bin/example-yolo2' failed
make[1]: *** [bin/example-yolo2] Error 1
make[1]: Leaving directory '/home/kida/openFrameworks_098/addons/ofxDarknet/example-yolo2'
/home/kida/openFrameworks_098/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:125: recipe for target 'Release' failed
make: *** [Release] Error 2
HOST_OS=Linux
checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl glfw3 gl glu glew gtk+-3.0 libmpg123
/bin/sh: 1: ./example-yolo2: not found
/home/kida/openFrameworks_098/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:169: recipe for target 'run' failed
make: *** [run] Error 127
Please tell me if you have a solution.
@kidapu Does this issue still exists? Were you able to get it working in Linux?
I'm very sorry for being quiet on this issue, I have not had time figure this out. I'll probably update ofxDarknet with the latest darknet repository soon and figure out a way to make this addon work on linux as well. I will check your fork @kidapu along the way, thanks for struggling <3
Hello, Was this resolved? Are there instructions for running on Linux? Thanks,
It seems development for this on hold at the moment? No updates for 1.5 years. I would be very much interested in a Linux version as well. Compiling darknet for linux is no problem for me. Is there anything I have to take care of when compiling it for this addon? Is the newest version compatible with the addon? Doesnt look like the function calls changed but it got restructured quite a bit.
I cloned
genekogan/linux
branch, and I edited addon.config for my local path, and run example-yolo2 by following command, then I encountered error...I can find
load_weights
andsave_weights
functions in libs/darknet/include/parser.h.Why do
xxx was not declared in this scope
errors happen?My enviroment is below.