Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify the layers to be "fine-tuned" in TF object detection API? [closed]

I followed the steps on TF object detection API tutorial page using the ssd_mobilenet_v1_pets.config configuration at https://github.com/tensorflow/models/blob/master/research/object_detection/samples/configs/ssd_mobilenet_v1_pets.config

It is very cool that I am able to train a custom detector using my own images. However, as the whole training process appears to me as a "black-box", I am wondering how I could configure the layers to be fine-tuned, just like how one could configure the layers to be retrained using an Inception model in tensorflow/keras.

I think that the layers to be fine-tuned could(should) be different if I had, say, 10000 images rather than 100 images.

like image 653
captainst Avatar asked Mar 04 '23 23:03

captainst


1 Answers

To fine tune a specific layer, you have to freeze the rest. If you know the name of the layers of your model you want to freeze, than you can add them to the freeze_variables (Source) in the train part of your config file.and add '*' in front of '.FeatureExtractor.'

For example, this:

train_config: {
...
freeze_variables: ".*FeatureExtractor."
}

will freeze all layers of the Feature Extractor of Faster R-CNN architecture.

like image 52
Janikan Avatar answered May 16 '23 06:05

Janikan