imsoo / darknet_server

Darknet (Open source neural networks framework) Server
MIT License
29 stars 7 forks source link

Client Not Running - Thread blocked at "while (!fetch_flag)" #7

Open Eddy32 opened 3 years ago

Eddy32 commented 3 years ago

First of all i'd like to congratulate you on this repository, really interesting work!

So, i was setting up your repo, following your read.me and i encountered some probelms, which i'll post below, in case you consider that my solution to them might be the reason for my client not working properly (and in case it isn't it will also help someone who may faced them aswell)

Issues along the way So, i'm running everything on a docker container wich is using "cuda:10.1-cudnn7-devel-ubuntu16.04" as the image (ubuntu 16.04 with everything set for GPU usage). The issues were the following: - First, after changing the darknet files and cloning your repo, i ran "make" on the server side and had issues due to the lack of the tbb library ![image](https://user-images.githubusercontent.com/33222129/100524454-42397900-31b0-11eb-8a54-864f901377f0.png) for this i simply installed the library with "apt install gcc libtbb-dev" which solved it. - Then i got this error message: ![image](https://user-images.githubusercontent.com/33222129/100524503-917fa980-31b0-11eb-9af0-22767ab0d8d2.png) which was solved by adding "#include \" to the src/yolo_detector.cpp - At this point it compiled without problems, but when running the worker it had problems finding/accessing the libdarknet.so ![image](https://user-images.githubusercontent.com/33222129/100524573-31d5ce00-31b1-11eb-877e-2d6918082587.png) for that i executed "/sbin/ldconfig -v" which worked like a charm. - Now all sink, ventilator and worker run (sometimes the worker can't find the weights file, but if i run it again that issue disappear, strange behavior). When trying to "make" the client side i got this errors ![image](https://user-images.githubusercontent.com/33222129/100524618-9bee7300-31b1-11eb-8125-dbf7d8fe5548.png) which i saw you answered [here](https://github.com/imsoo/fight_detection/issues/6#issuecomment-631177291) so i added "CV_" to the begging of those variables (except for CAP_PROP_BUFFERSIZE which for no aparant reason still wouldn't work, so i printed its value on a python script with opencv and replaced that variable with 38 [printed the other ones too to check if the values in c++ where equal to one i got in python]) ---------------------------------

After that everything was ready for the test run. As you mentioned on your read.me i exectued sink -> ventilator -> worker -> client

sink: image

ventilator: image

worker: image

everything up and running, so far so good, but when i run the client, it simply blocks, it does nothing: image

I checked via GDB what was happening and it simply blocks at line 195 while (!fetch_flag) image

That flag only changes to true in the case of detecting a camera (which in this scneario is never the case) or in the fetch_thread function, which i got say, is beyond me xD. Very rarely, when running the client (don't remeber if it is with that while on comment or not) it works properly and the sink, ventilator start printing a lot of data and the video starts running with the bounding boxs (since it is not deterministic behavior i assume somewhere it creates a race condition which enables it to work sometimes).

Can you please share some light on this, not sure where to look to fix this issue and would like to be able to run this since, has i said in the beginning, i find this project really fascinating Thanks for your time :)

imsoo commented 3 years ago

@Eddy32

Thank you for your interest in this project and sharing your issue.

That flag only changes to true in the case of detecting a camera (which in this scneario is never the case) or in the fetch_thread function, which i got say, is beyond me xD. Very rarely, when running the client (don't remeber if it is with that while on comment or not) it works properly and the sink, ventilator start printing a lot of data and the video starts running with the bounding boxs (since it is not deterministic behavior i assume somewhere it creates a race condition which enables it to work sometimes).

I agree with that. So I am trying to find synchronization problem in my program. I'll let you know as soon as I know.


And I think that the hyphen character ('-') in filename might be a cause of problem. Could you remove hyphen character in your input file name (video, cfg, weight) and try again?


If you have any questions, please feel free to comment. Thanks.

Eddy32 commented 3 years ago

And I think that the hyphen character ('-') in filename might be a cause of problem. Could you remove hyphen character in your input file name (video, cfg, weight) and try again?

Changed the name on all those files,

worker: image client: image

but the problem persisted :/

Thanks for your time and answer, if you find anything on what may be causing this, please let me know (and, if you don't mind me asking, on what OS and version did you run this program? so i can try to replicate it on a container to see if it may solve the issue)