Dear experienced ones:
I wonder how to remove the intermediate layers of a model. I know about this method below:
nn.Sequential(*list(model.children())[:-2])

The problem that my model has pooling layers and ReLU layers which are applied in the forward() method of the model and those modules would be missed using children().