facenet triplet loss with keras

后端 未结 4 1780
野趣味
野趣味 2021-01-31 09:50

I am trying to implement facenet in Keras with Thensorflow backend and I have some problem with the triplet loss.

I call the fit function with 3*n number of images and t

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 10:25

    Are you constraining your embeddings to "be on a d-dimensional hypersphere"? Try running tf.nn.l2_normalize on your embeddings right after they come out of the CNN.

    The problem could be that the embeddings are sort of being smart-alecs. One easy way to reduce the loss is to just set everything to zero. l2_normalize forces them to be unit length.

    It looks you'll want to add the normalizing right after the last average pool.

提交回复
热议问题