5

I have read tutorials on how to train a new class using TensorFlow Object Detection API. But what I want to do is to add a new class to the already trained classes of a pre-trained model.

For example : MS-COCO pre-trained model has 90 classes. I want to add one more class and detect objects for 91 classes.

1 Answer 1

7

Tensorflow object detection API supports starting from a pre-trained MS COCO checkpoint. Just set

fine_tune_checkpoint: "/usr/home/username/tmp/model.ckpt-#####"
from_detection_checkpoint: true

In your detection pipeline. (Official reference: https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/configuring_jobs.md)

You should add the images with your extra class to the coco dataset and finetune for all 91 classes, or your network might forget what it learned previously and only detect the new object.

Sign up to request clarification or add additional context in comments.

3 Comments

The MS COCO checkpoint already predicts 90 classes. I have data for the new class. Now should I combine the new class's data along with MS COCO data set, create TFRecords for all 91 classes and train from the network checkpoint?
Yes, otherwise the net will probably forget about COCO. Alternatively, you can try to implement the contents of the "Learning without forgetting" paper, that shows how to use only the new data to learn without forgetting the previous task. Source: arxiv.org/abs/1606.09282
@AndreaPisoni Do you know which files I need to copy when moving from a computer to another to retrain model? As you said, we need file mode.ckpt-#####. So I copy 3 file model.ckpt-#####. data-00000-of-00001, model.ckpt-#####.index and model.ckpt-#####.meta to the new directory. Then, I point the fine_tune_checkpoint to my new check point. But It found error that It cannot find my new checkpoint. After that, I copy file checkpoint in the old folder to new, but another error found: Unsuccessful TensorSliceReader constructor. Am I missing something?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.