title: Fine-tuning SSD Light torchvision
body: <p>I want to fine-tune an object detector in PyTorch. For that, I was using this tutorial:</p>
  <p><a href="https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html" rel="nofollow noreferrer">https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html</a></p>
  <p>However, FastRCNN model is not suitable for my use case so instead, I fine-tuned SSDLight. I wrote this code to set a new classification head:</p>
  <pre><code>from functools import partial
  from torchvision.models.detection import _utils as det_utils
  from torchvision.models.detection.ssdlite import SSDLiteClassificationHead
      
  model = torchvision.models.detection.ssdlite320_mobilenet_v3_large(pretrained=True)
  
  in_channels = det_utils.retrieve_out_channels(model.backbone, (320, 320))
  num_anchors = model.anchor_generator.num_anchors_per_location()
  norm_layer  = partial(nn.BatchNorm2d, eps=0.001, momentum=0.03)
  num_classes = 2
  model.head.classification_head = SSDLiteClassificationHead(in_channels, num_anchors, num_classes, norm_layer)
  </code></pre>
  <p>Since my model is not performing well, I want to ask the community if the above code is correct?</p>
  <p>Thanks in advance.</p>