-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error! Train with the pretrained model #134
Comments
Those shared weights are basic model only. Try loading using the import models
mm = models.buildin_models(
"r18", # Or "r18" / "r34" / "r100"
dropout=0,
emb_shape=512,
output_layer='E',
bn_momentum=0.9,
bn_epsilon=1e-5,
use_bias=True,
scale=True,
activation='PReLU'
)
mm.load_weights('glint360k_cosface_r18_fp16_0.1.h5')
... |
Thank you for your response. I have successfully run it. Could you please explain why the accuracy is very low when training on the https://github.com/X-zhangyang/Asian-Face-Image-Dataset-AFD-dataset and testing on LFW, CFP_FP, and AgeDB_30? with lr= 0.1 |
Try freezing backbone and training header only first: tt.train(
[
{"loss": losses.ArcfaceLoss(scale=64), "epoch": 2, "bottleneckOnly": True},
{"loss": losses.ArcfaceLoss(scale=64), "epoch": 17},
]
) And also use a smaller learning_rate like |
I tried freezing backbone and training header only first but accuracy in "cfp_fp" was only 0.93 while Ported Models r18: 0.977143 |
Maybe just a difference in image encoding qulity when saving those bin files, refer Reproduce the results #110. While freezing backbone, the accuracy shouldn't change. May test the basic_model accuracy firstly. |
I got it. Thank a lot |
“Hello, I'm a beginner . I’m encountering an error when loading pretrained weights
![Screenshot 2024-05-29 002602](https://private-user-images.githubusercontent.com/72916030/334512827-0a66a454-6041-403b-966e-d6b8e7add455.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MTY5NzIsIm5iZiI6MTcyMzkxNjY3MiwicGF0aCI6Ii83MjkxNjAzMC8zMzQ1MTI4MjctMGE2NmE0NTQtNjA0MS00MDNiLTk2NmUtZDZiOGU3YWRkNDU1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE3VDE3NDQzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY3ZGQwMWQ1OGJkYjQ3ZTEwODkxZWU1Yjg1YzkxOTY0NWY2NzcwY2IyZjRlYjYwZTY4NTIxYmQ0Njg0ZGI2MWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.PTasjzGwQcQmrWrx8LuZvXP2kk8M8P5ktPvPT-0sNLM)
glint360k_r18
to continue training with my new dataset. The error message is: ‘ValueError: Layer count mismatch when loading weights from file. Model expected 63 layers, found 62 saved layers.’”Thanks
The text was updated successfully, but these errors were encountered: