How to add additional layer( inside the features module) in pre-trained EfficientNetB0 model?

Author: sashika-himaliCreated Aug 6, 2023Updated Feb 16, 2024

Could you please guide me on how to add a multi-head attention layer after model. features[5:] . I want to add this layer inside the features . import torch import torchvision weights = torchvision. models.EfficientNet_B0_Weights.DEFAULT model = torchvision.models.efficientnet_b0(weights=weights).to(device)

Source: lukemelas/EfficientNet-PyTorch