Got a solution here:

  
    
    
    Index error using custom backbone on FasterRCNN vision
  
  
    I got the same error following the tutorial exactly, but the FasterRCNN documentation: 
https://github.com/pytorch/vision/blob/master/torchvision/models/detection/faster_rcnn.py 
suggests that  the featmap_names in the MultiScaleROIAlign should be a character, ‘0’, not an integer. I replaced 
roi_pooler = torchvision.ops.MultiScaleRoIAlign(featmap_names=[0],
                                                output_size=7,
                                                sampling_ratio=2)

with 
roi…