Hi everyone. As the title suggests, I want to modify the last few layers of the Semantic Segmentation networks provided by Pytorch. I want to use the output coming from the last ReLu layer to my own layer. I’m really having a tough time getting it working. So I’m trying to get the network output at the last ReLu layer which is just before the output layer.
t = torchvision.models.segmentation.deeplabv3_resnet50()
wow = nn.Sequential(*list(t.modules())[:-1])
wow(torch.ones((2, 3, 224, 224)).cuda())

The above code gives me an error saying
TypeError: conv2d(): argument 'input' (position 1) must be Tensor, not collections.OrderedDict

I’m really not able to understand where I am going wrong. So what I want is the output at the last but one layer. But I do not know how to access it.