darkflow
darkflow copied to clipboard
How to load pretrained weight of a partial network.
This is the answer from the author (Thanks for author's patient reply)
- Flatten all of your convolutional weight and concatenate them into a big long vector, in the order of lower layer first (input layer first).
- Initialize the dense layers, flatten and append them into the big long vector as well.
- Prepend 4 random bytes to your big long vector
- Dump the resulting big long vector to a binary file, say yolo-myConfig.weights
These can be done in a few Python lines of code. After that, you can now train on your pre-trained weight using main.py --model myConfig --train --noload