facebookresearch / facebookresearch/detectron2

Is it normal to re-train the entire model (all parameters) for fine-tuning?

Open
#4,805 0 comments 0 reactions 0 assignees View on GitHub
documentation
Dominant language
Python
Stars
34.7k
Forks
7.9k
PR merge metrics
No merged PRs in 30d

Description

## 📚 Documentation Issue

In the colab notebook linked from the readme (https://colab.research.google.com/drive/16jcaJoc6bCFAQ96jDe2HwtXj7BMD_-m5), there is a section about fine-tuning a model from the model zoo:

> "Now, let's fine-tune a COCO-pretrained R50-FPN Mask R-CNN model on the balloon dataset."

However it looks like the entire model is actually retrained - `sum(p.numel() for p in trainer.model.parameters() if p.requires_grad)` gives a number that is essentially the entirety of the model's parameters. This is not how I would normally understand fine tuning, where only the "last layers" (whatever those are in context) are re-trained?

This may just be because I am not very familiar with detection/segmentation tasks, but is it normal to retrain the entire model for a fine-tuning/transfer learning task?

Contributor guide

Open the contributing guide

Research direction

Start with the README-linked Colab notebook and the section describing fine-tuning the COCO-pretrained R50-FPN Mask R-CNN on the balloon dataset. Check the reported requires_grad parameter count against the notebook's trainer.model setup, then clarify in the documentation whether all parameters are intentionally trainable and what fine-tuning means in this example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.