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?