Base on your code, i think you are using this implementation of EfficientNet
check this link 1 for the source code and more information.
you can use extract_endpoints or extract_features.

Dictionary of last intermediate features
with reduction levels i in [1, 2, 3, 4, 5].
Example:


import torch
from efficientnet.model import EfficientNet
inputs = torch.rand(1, 3, 224, 224)
model = EfficientNet.from_pretrained(‘efficientnet-b0’)
endpoints = model.extract_endpoints(inputs)
print(endpoints[‘reduction_1’].shape)  # torch.Size([1, 16, 112, 112])
print(endpoints[‘reduction_2’].shape)  # torch.Size([1, 24, 56, 56])
print(endpoints[‘reduction_3’].shape)  # torch.Size([1, 40, 28, 28])
print(endpoints[‘reduction_4’].shape)  # torch.Size([1, 112, 14, 14])
print(endpoints[‘reduction_5’].shape)  # torch.Size([1, 320, 7, 7])
print(endpoints[‘reduction_6’].shape)  # torch.Size([1, 1280, 7,