omoindrot / tensorflow-triplet-loss

Implementation of triplet loss in TensorFlow
https://omoindrot.github.io/triplet-loss
MIT License
1.12k stars 284 forks source link

loss=0 in step=101(after two step) #47

Open mahsa631002 opened 5 years ago

mahsa631002 commented 5 years ago

hello i utilize your useful program for face recognition,my implemented network is inception resnet v2 and

  1. batch_size=16, 2.lr=0.001 3.embeding_size=128 4.train_size=708 5.eval_size=396 6.margin=0.5 7."triplet_strategy": "batch_all" loss = 0.5458313, step = 1 loss = 0.0, step = 101 (3229.453 sec) without pretrained weights and only with your implementation two layers CNN ,loss for evaluation goes to about 0.35(batch_size=64,lr=1e-4)with data augmentation .i use embeddings vector from PREDICTION mode as input of my SVM and KNN classifier but accuracies of both are too low about 10%. what do think about this low accuracy for recognition?which part do you think have caused this low accuracy (triplet part or classification part)?

omoindrot commented 5 years ago

If the batch size is too low (16) and you have a lot of different classes (ex: 100), you may have no valid triplet in your batch, which might give you a loss of zero.

Or maybe the model is not converging because the learning rate is too high.