Ok, I see. Assuming you don’t need to backpropagate through the Densenet, you could register forward hooks to each block and save the activation. Since you need a specific number of output channels, you could add an additional Conv2d layer with your defined out_channels after each Denseblock.
I created a small example of this approach:
activations = {}
def get_activation(name):
    def hook(model, input, output):
        activations[name] = output
    return hook
    

model = models.densenet121(pretrained=False)

# Register forward hooks with name
for name, child in model.features.named_children():
    if 'denseblock' in name:
        print(name)
        child.register_forward_hook(get_activation(name))

# Forward pass
x = Variable(torch.randn(1, 3, 224, 224))
output = model(x)

# Create convs to get desired out_channels
out_channels = 1
convs = {'denseblock1': nn.Conv2d(256, out_channels, 1,),
         'denseblock2': nn.Conv2d(512, out_channels, 1),
         'denseblock3': nn.Conv2d(1024, out_channels, 1),
         'denseblock4': nn.Conv2d(1024, out_channels, 1)}

# Apply conv on each activation
for key in activations:
    act = activations[key]
    act = convs[key](act)
    print(key, act.shape)

Let me know if that helps or if I misunderstood something!