Surekha_Gaikwad:

I know how to write code for it basically registering hooks for specific layer for which we want to visualize it but the main concern in my case is I am directly using pretrained model which does’t have any attribute or layer names which I can use in activation function (while passing layer name).


If I am understanding this right, you could make the hook a functools.partial function to pass the name of the layer. This could be obtained by installing the hooks in a loop over for name, m in model.named_modules():.
Best regards
Thomas