darkflow icon indicating copy to clipboard operation
darkflow copied to clipboard

How to load pretrained weight of a partial network.

Open littlelid opened this issue 10 years ago • 0 comments

This is the answer from the author (Thanks for author's patient reply)

  1. Flatten all of your convolutional weight and concatenate them into a big long vector, in the order of lower layer first (input layer first).
  2. Initialize the dense layers, flatten and append them into the big long vector as well.
  3. Prepend 4 random bytes to your big long vector
  4. 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

littlelid avatar Nov 01 '16 15:11 littlelid