import torch import torchvision from torch import nn def create_eff_model(): weights_eff=torchvision.models.EfficientNet_B2_Weights.DEFAULT transforms=weights_eff.transforms() #load model eff_b2_mod=torchvision.models.efficientnet_b2(weights=weights_eff) for param in eff_b2_mod.parameters(): param.requires_grad=False torch.manual_seed(42) torch.cuda.manual_seed(42) eff_b2_mod.classifier=nn.Sequential(nn.Dropout(p=0.3,inplace=True), nn.Linear(in_features=1408,out_features=101,bias=True)) return eff_b2_mod,transforms