TreB1eN / InsightFace_Pytorch

Pytorch0.4.1 codes for InsightFace
MIT License
1.74k stars 423 forks source link

a question about other models #54

Open lilinwei777 opened 5 years ago

lilinwei777 commented 5 years ago

I used other models like vgg16 or resnet50 in torchvision.models, loss can decline step by step,but validate accurancy dont't improve. always 50%. I don't know why. Do you have some opinions about this? class vgg(nn.Module): def __init__(self, embedding_size,net_mode): super(vgg, self).__init__() assert net_mode in ['vgg16'], 'mode should be vgg16' self.featuresvgg16 = vgg16(pretrained=True).features self.featuresLayer = nn.Sequential( nn.Linear(512 * 3 * 3, 4096), nn.ReLU(True), nn.Dropout(), nn.Linear(4096, embedding_size), ) def forward(self, x): x = self.featuresvgg16(x) x = x.view(x.size(0), -1) x = self.featuresLayer(x) # 512维特征 x = self.l2_norm(x) return x

TreB1eN commented 5 years ago

50% accuracy means something not right, with limited information I cannot tell what is it