Like this:
netD.main[14].register_forward_hook(get_activation('main[14]'))
output = model(img)
torch.Size([1, 3, 128, 128])
print("main[14]") 
act = activation['main[0]'].squeeze()
print(act.type)
num_plot = 4
fig, axarr = plt.subplots(min(act.size(0), num_plot))
for idx in range(min(act.size(0), num_plot)):
    print(idx)
    axarr[idx].imshow(act[idx],cmap="gray")