lukemelas / EfficientNet-PyTorch

A PyTorch implementation of EfficientNet
Apache License 2.0
7.85k stars 1.52k forks source link

Finetune on face recognition with resolution@224 problem by using EfficientNet-b0? #41

Closed yeluyue closed 5 years ago

yeluyue commented 5 years ago

Hi, I trained EfficientNet-b0 for face recognition task by using the Msceleb-1M. The classnum in my experiment is 512. However, the output of the last layer is always Nan just from the first iteration. Is it different between object classification task and face recognition task on EfficientNet ?

Catosine commented 5 years ago

Hi @yeluyue ! I'm also working on transferring EfficientNet-b0 to MS1M-Celeb. However, I'm using 1k-people set for my experiment.

In general, face identification has no difference compared with object recognition, for the algorithm won't know if you are sending it a human face or just a car.

As for your situation, I guess there might be something wrong with your preparation of data, for example, data preprocessing and/or data cleaning.

GL,

Catosine commented 5 years ago

Quick update: EfficientNet-b0 with cleaned 1k-people data has an result of valid top1 88.83 and top5 of 96.02. This is caused by b0 is not deep enough. Quick update 2: EfficientNet-b5 with same data has an result of valid top 1 94.654 and top5 of 98.446.

lukemelas commented 5 years ago

Thanks for the update!

lukemelas commented 5 years ago

Just wanted to say that now with #44, it is a lot easier to use a model with a different number of classes:

model = EfficientNet.from_pretrained('efficientnet-b1', num_classes=512)
lukemelas commented 5 years ago

Also, let me know if this is still an open issue or if it can be closed.

Catosine commented 5 years ago

Dope you actually add a control variables for different classes! That is what I really need now! Thanks man:) BTW I think it is definitely okay to close this issue. Thanks again for your amazing work!

lukemelas commented 5 years ago

Thank you so much for the reply! I am really happy to hear you are enjoying the repo!