tensorflow / tensorflow/models

Fine-tuning in model_main_tf2.py

Open
#10,818 3 comments 0 reactions 1 assignee View on GitHub

@laxmareddyp is already working on this.

Since Nov 2, 2022.

models:research type:docs
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

Prerequisites

Please answer the following question for yourself before submitting an issue.

  • I checked to make sure that this issue has not been filed already.

1. The entire URL of the documentation with the issue

https://github.com/tensorflow/models/tree/master/research/object_detection

2. Describe the issue

I have been looking around the source code, but I can't find how the actual fine-tuning is done. I know there is an option to train from a "detection" and from a "classification" checkpoint and I understand that this involves loading the weights from a previous checkpoint. But when it comes to training what layers are actually trained? Do you do transfer learning or do pertaining on the entire architecture?

I looked at the tutorials: https://github.com/tensorflow/models/blob/master/research/object_detection/colab_tutorials/inference_from_saved_model_tf2_colab.ipynb and I understand that here you are fine-tuning only the final 6 layers from the classification and regression heads and that makes sense, but when you train using the model_main_tf2.py file I can't find how the trainable_variables are selected.

There doesn't seem to be a selection class or function in the project. Can you customize in the model_main_tf2.py the layers that you want to fine-tune?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.