I tried to use this model for my object detection task
model =  retinanet_resnet50_fpn(pretrained=False, progress=True,
                           num_classes=num_classes, pretrained_backbone=pretrained_backbone)

Reference: vision/retinanet.py at master · pytorch/vision · GitHub
This error appeared. Help!
Epoch: [0]  [  0/457]  eta: 0:19:42  lr: 0.000032  loss: 1.8015 (1.8015)  classification: 1.1287 (1.1287)  bbox_regression: 0.6729 (0.6729)  time: 2.5873  data: 0.5801  max mem: 4855
Traceback (most recent call last):
  File "/raid/sahil_g_ma/wheatDetection/FRCNN_Resnet_training.py", line 99, in <module>
    train_one_epoch(model, optimizer, data_loader, device, epoch, print_freq=100)
  File "/raid/sahil_g_ma/wheatDetection/detection/engine.py", line 30, in train_one_epoch
    loss_dict = model(images, targets)
  File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/torchvision/models/detection/retinanet.py", line 547, in forward
    losses = self.compute_loss(targets, head_outputs, anchors)
  File "/opt/conda/lib/python3.6/site-packages/torchvision/models/detection/retinanet.py", line 411, in compute_loss
    return self.head.compute_loss(targets, head_outputs, anchors, matched_idxs)
  File "/opt/conda/lib/python3.6/site-packages/torchvision/models/detection/retinanet.py", line 51, in compute_loss
    'classification': self.classification_head.compute_loss(targets, head_outputs, matched_idxs),
  File "/opt/conda/lib/python3.6/site-packages/torchvision/models/detection/retinanet.py", line 120, in compute_loss
    ] = 1.0
IndexError: tensors used as indices must be long, byte or bool tensors

Also How can I use resnet152fpn as backbone of retinanet?