As the question states, I have loaded the pretrained Resnet101 (model = models.resnet50(pretrained=True)) model in pytorch and would like to know how to selectively modify the weights of layers and test the model.
Lets say for simplicity that there are only 5 bottlenecks b1,b2,b3,b4,b5 in the model followed by one FC layer fc1. I would like to keep the weights for the layers in b1 (first bottleneck) while setting the weights of every layer in the following bottleneck after that to 0 so I can see how it performs just using the b1 weights.
Here is a good visualization of the ResNet architecture: Resnet50 110
And here is what b1 would look like starting at the pool1 layer all the way up to res2a:

Screen Shot 2017-05-11 at 1.11.10 AM.png930×1646 74 KB

Thank you!