darknet_server
darknet_server copied to clipboard
Loading weights from ...Couldn't open file:
When you run worker, "Loading weights from ... Coouldn't open file:" error occurs.
@ChangSeobYun Hi,
-
Which do you want to run, Yolo or Openpose?
-
Did you download weight file and put it in "weight" directory?
-
Please write your full command , it should be like
./worker "YOUR CFG PATH" "WEIGHT PATH" "NAMES PATH" -gpu 0 -thresh 0.2
./worker cfg/yolov3.cfg weights/yolov3.weights names/cooc.names -gpu 0 -thresh 0.2
I solved. thanks
I have another question. what is ./sink and ./ventilator?
@ChangSeobYun
- Ventilator : A ventilator that distribute tasks that can be done in parallel
- Worker : A set of workers that process tasks
- Sink : A sink that collects results back from the worker processes
For example,
- client sends the webcam video stream to the server(Ventilator).
Client -- Frame4 -- Frame 3 -- Frame 2 -- Frame 1 --> Server (Ventilator)
- Ventilator receive frame and distribute to Worker. (In this case, Assume that three Worker processes are running)
Ventilator -- Frame 1 --> Worker 1
Ventilator -- Frame 2 --> Worker 2
Ventilator -- Frame 3 --> Worker 3
Ventilator -- Frame 4 --> Worker 1
(Repeat)
- Workers process frame (neural network computation) and send result to Sink. (Note that worker 3 could process faster than worker 2)
Worker 1 -- Processed Frame 1 --> Sink
Worker 3 -- Processed Frame 3 --> Sink
Worker 2 -- Processed Frame 2 --> Sink
- Sink collects results back from the worker and send result to client in sequence
Workers -- Frame 2 -- Frame 3 -- Frame 1 --> Sink -- Frame 3 -- Frame 2 -- Frame 1 --> Client
Why use this?
Suppose the time to process one frame is 1 second. If there are five frame and one worker process, it takes 5 seconds. However, using two workers, it will be halved.
1 worker: total elapsed time: 5034 msecs.
2 workers: total elapsed time: 2421 msecs.
4 workers: total elapsed time: 1018 msecs.
accompanying document should help: http://zguide.zeromq.org/page:all#Divide-and-Conquer
I don't raw output detection box. what is problem?
@ChangSeobYun
- Check that the Server-Client is working.
Set DEBUG flag in Makefile and rebuild it. and then check standard output.
https://github.com/imsoo/darknet_server/blob/93a32e44d18ecdcc49d3803dc0d4947eef03bd3c/server/Makefile#L1
run server (sink, ventilator, one worker process) and then run client It should be like :
Ventilator | Recv From Client | SEQ : 0 | LEN : 12345
Ventilator | Send To Worker | SEQ : 0 | LEN : 12345
...
Worker | Recv From Ventilator | SEQ : 0 | LEN : 12345
Darknet | Detect | SEQ : 0 | Time : 50ms
Worker | Send To Sink | SEQ : 0 | LEN : 13456
...
Sink | Recv From Worker | SEQ : 0 | LEN : 13456
Sink | Pub To Client | SEQ : 0 | LEN : 13456
- If networking is fine, then try to change threshold.
./worker cfg/yolov3.cfg weights/yolov3.weights names/cooc.names -gpu 0 -thresh ***0.2***
- Please write your full command or post any picture. It should be helpful.
./worker cfg/openpose.cfg weights/openpose.weight -gpu 0 -pose
I think that Server/Client couldn't connect.
-
where is the server running? Local OR Remote (GCP, AWS ...)
-
check that server address in client command.
For example (Local),
./darknet_client -addr 127.0.0.1 -vid test.mp4
- Please post server process's (Sink, Ventilator, Worker) output.
I solved. thanks. An error occurred while executing the action.py ImportError: cannot import name 'set_session' from 'tensorflow.keras.backend'
@ChangSeobYun
I think that different keras version is a cause of this error. Which version of tensorflow and keras do you have? if you let me know, i will try it.
tensorflow==2.1.0 and Keras==2.3.1
@ChangSeobYun
Note : This is a temporary solution. it may not work correctly in your environment. So please let me know the result.
Try to change 7-12 Line in action.py and retry it.
From
from tensorflow.keras.backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
set_session(sess)
sess.run(tf.global_variables_initializer())
To
## TF 2.0
from tensorflow.compat.v1.keras.backend import set_session
tf.compat.v1.disable_eager_execution()
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
sess = tf.compat.v1.Session(config=config)
set_session(sess)
sess.run(tf.compat.v1.global_variables_initializer())
i just use one computer. then not working
@ChangSeobYun
Is the server (worker, Sink, Ventilator) running on the same computer?
@ChangSeobYun Hi,
1. Which do you want to run, Yolo or Openpose? 2. Did you download weight file and put it in "weight" directory? 3. Please write your full command , it should be like
./worker "YOUR CFG PATH" "WEIGHT PATH" "NAMES PATH" -gpu 0 -thresh 0.2 ./worker cfg/yolov3.cfg weights/yolov3.weights names/cooc.names -gpu 0 -thresh 0.2
Hi @imsoo, great work with this repo! I am having a similar issue to the issue shown at the top:
Loading weights from ...Couldn't open file
I am running the following: ./sink ./ventilator ./worker cfg/yolov3.cfg weights/yolov3.weights names/coco.names -gpu 0 -thresh 0.2
and then am getting the error. Any ideas on how to fix this? Also, after running ./sink and ./ventilator am I supposed to be getting output on the terminal? Because I am not getting any output after running them.
안녕하세요, @imsoo.
저도 같은 에러가 발생했는데요.
darknet, darknet_server를 받아서 make까지 완료하였고, sink와 ventilator를 실행하고나서 이 issue에서 가이드 해주신 명령어대로 worker를 실행했는데도 오류가 발생합니다.
왜 "Loading weights from ...Couldn't open file" 에러 메세지가 뜨는 지 아시나요?