Darknet: one more question about fine-tuning vs transfer-learning

Created on 6 Jan 2018  路  3Comments  路  Source: AlexeyAB/darknet

Hello @AlexeyAB
A quick question:
I have modified the (yolo.cfg's) last filters into 45(for 4 classes) and also the classes into 4 to train my own dataset with yolo.weights: ./darknet detector train cfg/yolo4.data cfg/yolo.cfg yolo.weights.
It really worked. I do not know weather it means fine-tuning or not. #245

Most helpful comment

@VanitarNordic Yes, I'll add it to readme.

  • Transfer-learning (without stopbackward=1) - achieves better accuracy, but trains longer and harder (can lead to Nan), also without stopbackward=1 you can train from scratch without pre-trained weights

  • Fine-tuning (with stopbackward=1) - has less accuracy, but trains faster and easier, you can't fine-tune without pre-trained weights

Difference between Trainsfer-learning and Fine-Tuning: https://groups.google.com/d/msg/darknet/WvBFz4zSSH4/k4wZeDuOAgAJ

All 3 comments

Hi @shootingliu

  • If all layers changed - this is transfer learning
  • If only some top layers changed - this is fine tuning

For fine tuning you can add here: https://github.com/AlexeyAB/darknet/blob/ea09a6e0b38e1ddf43ffcd81d27f0506411eb8e4/cfg/yolo.cfg#L232
this line: stopbackward=1

I added this in some last commit: https://github.com/AlexeyAB/darknet/commit/9ac78d8b84f6a059d2cefe22a10aa60de5b3feaf

@AlexeyAB

So which of them is better? fine tuning or transfer learning?

Please add some info in the readme about this parameter, stopbackward=1

@VanitarNordic Yes, I'll add it to readme.

  • Transfer-learning (without stopbackward=1) - achieves better accuracy, but trains longer and harder (can lead to Nan), also without stopbackward=1 you can train from scratch without pre-trained weights

  • Fine-tuning (with stopbackward=1) - has less accuracy, but trains faster and easier, you can't fine-tune without pre-trained weights

Difference between Trainsfer-learning and Fine-Tuning: https://groups.google.com/d/msg/darknet/WvBFz4zSSH4/k4wZeDuOAgAJ

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasleen137 picture jasleen137  路  3Comments

Greta-A picture Greta-A  路  3Comments

kebundsc picture kebundsc  路  3Comments

jetsonnano2020 picture jetsonnano2020  路  3Comments

off99555 picture off99555  路  3Comments