The clean approach would be to derive a custom class from ResNet and use vanilla nn.ReLU modules instead of the inplace version.
The hacky way would be to just replace the “unwanted” inplace ReLUs:
model = models.resnet50(pretrained=True)
model.layer2[1].relu = nn.ReLU()
model.layer3[2].relu = nn.ReLU()
model.layer4[1].relu = nn.ReLU()
for n, m in model.named_modules():
    if n == 'layer2.1.bn1' or 'layer3.2.bn2' or 'layer4.1.bn3':   
        m.register_forward_hook(get_activation_student(n))