Hi
I have this model

getred.PNG765×408 15.2 KB

And I got rid of the layers in red.
like this
removed = list(model.children())[:-2]
model = nn.Sequential(*removed)
print(model)

But ends up losing the name of my layer

number.PNG792×519 18.2 KB

Is there any thing I can do to keep the name of the layers. Because I might refers to them latters