I’m currently trying use inceptionv3 as a feature extractor but while trying to remove the last layer an error showed up which is the expected 3d or 4d in conv2d, here’s my code to remove the last layer
download and initiate the inceptionv3 (this works)
Wrapping modules into nn.Sequential containers will drop all functional API calls from the original forward method.
In your case you would need to check if the layers are still called in the same order as seen here (of course the aux path will be missing).
If you only want to remove the self.fc layer you could instead replace it with an nn.Identity without any further modification to the model.
If your use case is more complicated, derive a custom nn.Module from the base model and rewrite the forward as you wish.