RetinaNet (from torchvision) fine tuning

Hi all, I want to fine-tune retinanet from torchvision using the pipeline from https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html, but a couple of issues happening. For the model, I am altering the pretrained model with the following code for one object class:

model = torchvision.models.detection.retinanet_resnet50_fpn(pretrained=True)
num_anchors=model.head.classification_head.num_anchors
in_channels=model.head.classification_head.conv[0].in_channels
model.head=RetinaNetHead(in_channels, num_anchors, 2)

The issue is the evaluation gives absolute zero on every metric and loss shows nan randomly for the same data.

1 Like

Hello there, I was wondering if you managed to solve this issue? I am having similar troubles.

I have read that others changed the learning rate and opted for SGD instead of Adam, but I wanted to use ADAM.

I got some preliminary results using Adam. But I tried out some learning rates. I suggest doing a small grid search for a few epochs.

Ah cool, thank you for your reply.
So from your experience, working with ADAM was ok and the solution could be trying different learning rates. Also, thank you for your suggestion. I’ll try and see how to implement a grid search.