tensorflow / tensorflow/models

Lack of Documentation on Transfer Learning

Open
#9,636 5 comments 3 reactions 3 assignees View on GitHub

@pkulzc is already working on this.

Since Jan 15, 2021.

models:research:odapi 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/meta_architectures/ssd_meta_arch.py

2. Describe the issue

Background:
In the function 'restore_from_objects' on line 1295, the argument 'fine_tune_checkpoint_type' can take 3 options: 'classification', 'detection' and 'full'. As far as I can tell (there is no documentation on this) this corresponds to the value in the config file for the network. However, 'full' does nothing and raises an error. I am trying to perform transfer learning on only the last layer for the classification head and the box prediction head and so want to load and freeze everything else. It is incredibly unclear but I don't think setting as 'detection' restores the weights for the classification and box prediction towers. The main issue is the lack of documentation of how everything links together. Restoring the weights and freezing everything is obviously possible looking at the tutorial (https://github.com/tensorflow/models/blob/master/research/object_detection/colab_tutorials/eager_few_shot_od_training_tf2_colab.ipynb), but I chose to use the API as I was trying to avoid writing custom training code. My current focus is for the ssd_meta_architecture but I believe this applies to all architectures.

Issue:
There is basically no documentation (that I have found) that tells you how to load everything but the last layer, add a new one, and then train it. Could this be addressed? Navigating the git repo trying to piece everything together yourself is far too time-consuming.

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.