Hi, dear ptrblck
can you help me?
I want to use vgg16 pretrained  in my model.
I want to give  images to the pretrained vgg16 model and give the output of it again to several convolution layers.
But in the forward function, I do not know how to give the image to the pretrained vgg16 .
class attention_block(nn.Module):
def init(self):
super(attention_block, self).__init__()

vgg16 = models.vgg16(pretrained=True)
vgg16.to(device)
for param in vgg16.features.parameters():
param.requires_grad = False
self.Global_1 = nn.Conv2d(512,128,kernel_size=3, padding=1)

self.conv2_bn6= nn.BatchNorm2d(128)

self.Global_2 = nn.Conv2d(128,128,kernel_size=3, padding=1)

self.conv2_bn7= nn.BatchNorm2d(128)

self.Global_features = nn.Conv2d(128,128,kernel_size=1, padding=1)

self.Global_Score = nn.Conv2d(128,2,kernel_size=1, padding=1)

########################################################################
#fully connected

self.fc1 = nn.Linear(10*10* 208, 64)

self.fc2 = nn.Linear(64,32)

self.fc3 = nn.Linear(32,2)

##############################################################################

def forward(self, x):
out = vgg16(x)

Global_Score = self.Global_Score(self.Global_features(F.relu(self.conv2_bn7(self.Global_2(F.relu(self.conv2_bn6(self.Global_1(out))))))))



 # inception module############################################################################################# 

final_out= torch.sigmoid(F.dropout(self.fc3(torch.sigmoid(F.dropout(self.fc2(torch.sigmoid(F.dropout(self.fc1(Global_Score .view(Global_Score .size(0),-1))))))))))



return final_out