Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to train from scratch in TensorFlow object detection API?

The github issue 2446 says if we want to train from scratch, we need to comment this line in the model.config:

#fine_tune_checkpoint: "PATH_TO_BE_CONFIGURED/model.ckpt"
from_detection_checkpoint: true

I followed this issue and commented this line for training the SSD_mobilenet in my own dataset. It can train and the loss can reduce, but the accuracy keep at 0.0.

I used the object detection api before with pre-train model from model zoo, it works well at mAP=90%, the only difference between these two tasks is the comment line in model.config.

I want to know how to train a detection model from scratch using the object detection api in TensorFlow. Thanks!

like image 674
xinyu liu Avatar asked Mar 05 '18 03:03

xinyu liu


1 Answers

I would suggest you to go on with fine-tuning your model instead of training it from scratch. Training a model from scratch requires more computation time for the model to converge, this means you are again starting with random weights and you are tuning them until they converge, this will converge eventually, but the time to converge might be a week or a month as it is a large neural net.

In fine-tuning, you will use the previous weights, but you will tune them according to your own dataset, the end result is your model that helps you for the detection in your own dataset. The end model is also more or less a result of training from scratch, as the model will only work on your new dataset and new classes.

like image 90
saikishor Avatar answered Oct 22 '22 03:10

saikishor