I dont know if I understood you very well but I think that you need to add this kind of thing in your model’s definition since the begining like for example.
in the forward function, put each output of each layer inside a list and then return the whole vector after that and therefore you’d be able to access any output of any layer.
This worked for me before.