I have developed a customized SpecialConv2d layer that is mostly the same as nn.Conv2d, but does a couple extra things.
I would like to replace all nn.Conv2d layers in a pretrained Faster-RCNN instance with SpecialConv2d, but there doesn’t seem to be a .features property that I can access. How would I go about doing that?
import torchvision
import torch
import specialconv
frcnn = torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True)
# I'd like to iterate over everything in frcnn
# and replace all torch.nn.Conv2d layers
# with specialconv.SpecialConv2d layers