StevenBanama / C3AE

C3AE implement
BSD 2-Clause "Simplified" License
86 stars 16 forks source link

How do you add the gender estimation branch #14

Closed yanyanlimingkun closed 4 years ago

yanyanlimingkun commented 4 years ago

StevenBanama,Excuse me,recently, I am using your library. I want to add the gender estimate on your net,so i want to ask how do you add the gender estimation branch. Looking forward to your reply

StevenBanama commented 4 years ago

U can make full of the feature before last dense as same as age prediction.

StevenBanama commented 4 years ago

gender branch has been released. you can find it in nets/C3AE_expand.py

StevenBanama commented 4 years ago

Hello,StevenBanama Thank you for your good work! I want to ask you a question:when I used the model of gender estimation to do pre-training, I found that all loss is nan, only the accuracy of gender estimation is valuable. I am training now and find that when I iterate to a certain epoch, loss will also become nan. So I want to ask what the reason is.Could you please tell me?Thank you very much.

firstly, can you provide you command lines and enviroment? Maybe you'd add params "-gpu".

All models trained in tesla-P40. You'd pretrain from imdb-wiki if you want to retrain from plain.

yanyanlimingkun commented 4 years ago

StevenBanama: my command line is: python nets/C3AE_expand.py -se --source "afad|utk|asia" -gpu -p ./model/c3ae_model_v2_10_4.385814-0.954 I trained in GeForce RTX 2080 Ti. I didn't pre-train on imdb-wiki. Can you see where there is a mistake? Thank you very much.

StevenBanama commented 4 years ago

Hello,StevenBanama Thank you for your good work! I want to ask you a question:when I used the model of gender estimation to do pre-training, I found that all loss is nan, only the accuracy of gender estimation is valuable. I am training now and find that when I iterate to a certain epoch, loss will also become nan. So I want to ask what the reason is.Could you please tell me?Thank you very much.

firstly, can you provide you command lines and enviroment? Maybe you'd add params "-gpu".

All models trained in tesla-P40. You'd pretrain from imdb-wiki if you want to retrain from plain.

Maybe I will test it at weekends. Because i have other type gpu at hand. If tensorflow checkpoints does not work, h5 model may be release few days later.

yanyanlimingkun commented 4 years ago

When I trained yesterday, I trained two, one with GEM and Mish, and the other without. Today, I found that the one with Gem and mish appeared the situation that loss is nan, but the one without it did not appear, so it may be the nan problem caused by these two

StevenBanama commented 4 years ago

When I trained yesterday, I trained two, one with GEM and Mish, and the other without. Today, I found that the one with Gem and mish appeared the situation that loss is nan, but the one without it did not appear, so it may be the nan problem caused by these two.

you'd better change the epislon(1e-6) of focal loss, which may cause it.

FT = -1 * (one_minus_p * gamma) tf.math.log(tf.clip_by_value(prediction_tensor, 1e-8, 1.0))

change 1e-8 to 1e-6

StevenBanama commented 4 years ago

StevenBanama: my command line is: python nets/C3AE_expand.py -se --source "afad|utk|asia" -gpu -p ./model/c3ae_model_v2_10_4.385814-0.954 I trained in GeForce RTX 2080 Ti. I didn't pre-train on imdb-wiki. Can you see where there is a mistake? Thank you very much.

this exist a bug in tensorflow. -->https://github.com/tensorflow/tensorflow/issues/38698.

I had updated in master.U can have a test. If any problem exist, feel free to talk to me!