Hmm that’s weird, I just tried it with the block you provided and that’s what I get:
>>> x = torch.rand(1, 128, 64, 64)
>>> block3 = nn.Sequential(nn.Conv2d(128, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)),
...                  nn.ReLU(),
...                  nn.Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)),
...                  nn.ReLU(),
...                  nn.Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)),
...                  nn.ReLU())
>>> activation = {}
>>> for layer_name, layer in block3._modules.items():
...     print(layer_name, layer)
...     block3[int(layer_name)].register_forward_hook(get_activation(layer_name))
...
0 Conv2d(128, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
<torch.utils.hooks.RemovableHandle object at 0x101aa9ba8>
1 ReLU()
<torch.utils.hooks.RemovableHandle object at 0x10a1452e8>
2 Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
<torch.utils.hooks.RemovableHandle object at 0x101aa9ba8>
3 ReLU()
<torch.utils.hooks.RemovableHandle object at 0x10a1452e8>
4 Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
<torch.utils.hooks.RemovableHandle object at 0x101aa9ba8>
5 ReLU()
<torch.utils.hooks.RemovableHandle object at 0x10a1452e8>
>>> block3(x).shape
torch.Size([1, 256, 64, 64])
>>> activation.keys()
dict_keys(['0', '1', '2', '3', '4', '5'])