meso-unimpressed / darknet-net

A fork of darknet that is able to send detection data out via osc and websockets.
http://meso.design
Other
7 stars 1 forks source link

error when building on a fresh installation of Jetpack 4.2 #9

Open artynet opened 5 years ago

artynet commented 5 years ago

building the sources returns this error :

ar rcs libdarknet.a obj/gemm.o obj/utils.o obj/cuda.o obj/deconvolutional_layer.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/detection_layer.o obj/route_layer.o obj/box.o obj/normalization_layer.o obj/avgpool_layer.o obj/layer.o obj/local_layer.o obj/shortcut_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/crnn_layer.o obj/demo.o obj/batchnorm_layer.o obj/region_layer.o obj/reorg_layer.o obj/tree.o obj/lstm_layer.o obj/communication.o obj/convolutional_kernels.o obj/deconvolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/network_kernels.o obj/avgpool_layer_kernels.o
obj/communication.o:(.data.rel.local+0x0): multiple definition of `errors'
obj/demo.o:(.data.rel.local+0x0): first defined here
collect2: error: ld returned 1 exit status
Makefile:99: recipe for target 'libdarknet.so' failed
make: *** [libdarknet.so] Error 1
make: *** Waiting for unfinished jobs...

while the plain darknet source builds fine. I can't find where editing the C sources so not to have symbol overlapping...

timonsku commented 5 years ago

For some reason it seems to link against darknet.h twice. Might come from some changes in newer versions of gcc. You could try commenting https://github.com/meso-unimpressed/darknet-net/blob/master/src/communication.h#L6 Hard to say where it exactly happens though. I don't have a Jetson board anymore to test it there.

timonsku commented 5 years ago

Can not reproduce it on Ubuntu 18.04 with GCC 8.2.0 Maybe try a clean compile by running make clean. If that doesnt help maybe try cloning the repo fresh.

timonsku commented 5 years ago

Please note that I pushed some changes which include changing the default Makefile flags to not use CUDA and CUDNN to have it compile for CPU by default. If you are running on a Jetson you will want to change that back if you make a fresh clone now.

artynet commented 5 years ago

It seems a problem related to AR than to GCC itself (if you notice that at the beginning of the output). And the symbols should be overlapping in the bare C sources I think....

Anyway....still the same error ! (gcc v7.3.0)

timonsku commented 5 years ago

Well gcc is responsible for compiling, if it pulled in darknet.h for both objects then the linker will throw the error you are facing when it tries to link them together. Unfortunately I can't really help further as I am not able to reproduce the issue myself.

artynet commented 5 years ago

I see,

next monday I'll start again working on it and let you know. Are you planning to update the base darknet code ? just to know....

Kind Regards

timonsku commented 5 years ago

I was thinking about it but didn't have the time yet. I don't know how much has changed. The project structure definitely has changed though which could make it a bit harder to merge.

artynet commented 5 years ago

@PTS93 I just whipped up this simple patch :

https://github.com/artynet/darknet-pjreddie/commit/7c9aa7f287a4efa3ad6497608af367ea9d29ba88

would you mind taking a quick look at it ? It seems to be working quite fine after the build on my x86_64 home pc....and integrates fine with https://github.com/moovel/lab-opendatacam as well ! Waiting for your feedback !

timonsku commented 5 years ago

Thanks for taking a look. Unfortunately this is missing a large portion of the features of darknet-net but it looks like the structure hasn't changed too dramatically. I will have a look next week and do a proper merge. It seems it shouldn't take too long.

artynet commented 5 years ago

ok great ! I'll be looking forward for the new release. In the meanwhile i'll try to add the missing parts. Of course the risk is to make a sloppy work but please follow my next commits since they might be of help to you anyway.

Have a nice weekend and we'll start adjourning next week !

Best, Arturo

artynet commented 5 years ago

Hello @PTS93,

I went further with the porting on my repository, please take a look at it and return me some feedback at your convenience.

Best, Arturo

timonsku commented 5 years ago

Hi @artynet thank you for putting work into this. Though could you do these patches on top of a fork of this repo? It will be hard to merge it in the end otherwise and its currently very cumbersome for me to check what has changed in regard to this repo and to see what is still missing. I compiled your changes but can not get it to run with ./darknet detector demo cfg/voc.data cfg/yolov3-tiny.cfg yolov3-tiny.weights -c 0 -address "ws://echo.websocket.org" Something seems be out of order with the cli flags and it confuses -address as an argument for a video file.

artynet commented 5 years ago

i'll look into this. in the meanwhile try with :

./darknet detector demo cfg/voc.data cfg/yolov3-tiny.cfg yolov3-tiny.weights -c -1 -address "ws://echo.websocket.org"

where the -1 index takes the first vodep device available (start-darknet worked for me !).

timonsku commented 5 years ago

That is still failing for me:

video file: -address
Couldn't connect to webcam.
: No such file or directory
darknet: ./src/utils.c:256: error: Assertion `0' failed.
Aborted (core dumped)
artynet commented 5 years ago

please rebuild from the branch net-tab-fix and let me know....

timonsku commented 5 years ago

Sorry I was just on the wrong branch. Its working fine for me as well! If you could fork and merge your changes I can help you put in the last missing pieces.

artynet commented 5 years ago

that's great news @PTS93 ! I think, however, that you should start from my repository (which is based on the edge trunk of darknet) and then add the final touches.

Best, Arturo

timonsku commented 5 years ago

I can do that though the easiest way would be to overwrite most files, this would mean I can't really do a proper merge between the two repos and retain your commit history. Is that ok for you?

artynet commented 5 years ago

Absolutely, please go ahead and proceed. I think we have to reach a common goal and I won't care about the commit history....of course a mention for my work would be really appreciated ;)

timonsku commented 5 years ago

Of course, I will add a contributer section to the Readme I have a Jetson Nano now, so I can test there as well.