-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EfficientNet without Top Layers #192
Comments
Overwrite the forward method to yield the features map of the desired layer |
Yes, or add an option to the initialization of the network that allows dropping these layers (similar to how EfficientNet is implemented in Tensorflow). |
@nwschurink 's solution is much better, but in the mean time, an alternative is to substitute them with Identity layers:
|
This is now integrated :) |
@lukemelas is it going to be in the next pip version? Or do you know when it's planned for release? |
I tried to remove top layers like follows:
base_model = EfficientNet.from_pretrained('efficientnet-b3')
model = nn.Sequential(*list(base_model.children()[:-3]))
x = torch.randn((1,3,300,300))
model(x)
It throws "NotImplementedError" for forward(). Is there a way to not include top layers?
The text was updated successfully, but these errors were encountered: