How To Use The First Layers Of Model In PyTorch
I have uploaded a certain model
from efficientnet_pytorch import EfficientNet
model = EfficientNet.from_pretrained(model)

And I can see the model:
print(model.state_dict())

The model contains quite a few layers, and I want to take only the first 50. Please tell me how I can do this.

I think this should do the trick:
model = nn.Sequential(*list(model.classifier.children())[:50])

