david-svitov/margindistillation

Model mobilefacenet with margindistillation is so large?

luan1412167 opened this issue · 4 comments

Hi, thanks for your work,
I'm testing the model, I have downloaded your margindistillation model trained with mobilefacenet but the weight is so large near 180MB, why so?

HI, it includes the last FC layer of the network, which is classified into 85,000 classes. So this is 512x85000 additional parameters. That is, approximately 174MB. This layer is not needed for inference and you can cut out it.

Thanks for your reply,
Can I remove FC layer with https://github.com/deepinsight/insightface/blob/master/deploy/model_slim.py in insightface repo?
Sorry because I can't test it now, so I only want to confirm I can remove it with the script.
I higtly appreciate your help.

Yes, it looks like you can use this script

@david-svitov thanks for your help, I have cut it. The model looks better than insightface model. Your works are awesome