Open ahmed-nady opened 3 years ago
For DETR in general the adjustment in the linear layer works fine, it might work as well for deformable DETR. I don't see any reason why it would not generalize to deformable DETR. If there is any difference I would be very interested in knowing it.
Thanks for your note.
@ahmed-nady @lucastononrodrigues
Hey there. Thank you for the discussion. Is the linear layer you guys are talking about is the one below, which is the final fc layer in the prediction head? https://github.com/fundamentalvision/Deformable-DETR/blob/11169a60c33333af00a4849f1808023eba96a931/models/deformable_detr.py#L54
Or should I adjust the other linear layers such as nn.Linear(hidden_dim, hidden_dim) in the prediction head?
Is there any final conclusion, I am also looking to fine tune on custom dataset.
Is it also possible to freeze the previous layers and fine tune on only last 3 layers. I don't see the code for freeze the model. But only for the mask (segmentation) model.
I just needed this and did almost the same as in DETR. Deleting the prediction-head (FC-layers) from the resumed model. Using the original code-base a model I constructed to my needs (number of classes) and the resumed model's parameters is copied over (no changes). If the number of classes is different, this needs to be handled. I simply omit the transfer of this, which is not necessarily the smartest trick.
Thanks for sharing the Deformable -DETR code. Can you clarify recommendations for training on a custom dataset? Should we build a model from scratch, or better to use and fine-tune a full coco pretrained model and adjust the linear layer to desired class count?