thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.14k stars 2.07k forks source link

Finetuning #299

Open borasy opened 7 years ago

borasy commented 7 years ago

Hi When we finetune the last layer with pre-trained weights, does the weights on the last layer only that get updated or the whole weights of the model get updated along with the last layer. Thanks

tungalbert99 commented 7 years ago

Not the contributor, but I believe in the README it says:

In this case, every layer will have the same exact number of weights except for the last two, so it will load the weights into all layers up to the last two because they now contain different number of weights.

borasy commented 7 years ago

I understand that the pre-trained weights will be loaded except the last two but during training phase, will the weights on the last layer only that gets updated or the whole weights of other layers as well?

tungalbert99 commented 7 years ago

I took a brief look through the code and it looks like the entire model gets updated. There doesn't seem to be any "freezing" of trainable layers that I can perceive.

borasy commented 7 years ago

hmm.. i think you're right. it's probably why my training takes really long to train although my dataset is really small. I think I should request to the developer to add the 'freezing' feature.

bhargavajs07 commented 7 years ago

Is the weight freezing feature added yet ? can you please point to how we could use it ?