Hi, Thanks
I’m confused and do not know how to correct the code. I do not have much experience in deep. Can you please help me?
class attention_block(nn.Module):
def init(self):
super(attention_block, self).__init__()
self.vgg16 = models.vgg16(pretrained=True) 
self.vgg16.fc = Identity()
print(self.vgg16)

self.vgg16.to(device)
for param in self.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 = self.vgg16(x)
print(out.shape)
Global_Score = self.Global_Score(self.Global_features(F.relu(self.Global_2(F.relu(self.Global_1(out))))))
Global_Score = Global_Score.repeat(1, 64, 1, 1)

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