Skip to content
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

about Fine Tuning #1

Open
zogojogo opened this issue Jan 5, 2022 · 1 comment
Open

about Fine Tuning #1

zogojogo opened this issue Jan 5, 2022 · 1 comment

Comments

@zogojogo
Copy link

zogojogo commented Jan 5, 2022

hi I'm struggle when I want to fine tune pretrained model with my custom dataset. Is there any method to do it? especially to train with pretrained weights and using a custom dataset. Thank you

@jonasgrebe
Copy link
Owner

jonasgrebe commented Jan 6, 2022

Hey Kristian, you will have to load your pretrained model similarly as in the backbones/build.py and make sure that the output dimension is your embedding size and flat. You might have to add a 'classifier' header (sorry for the misleading variable name in the code) in order to get the embedding size that you want or reduce a convolutional tensor to a flat embedding. If you want to use a pretrained model (on ImageNet) that I already implemented, such as AlexNet, VGG16, or MobileNetV2, then you can just provide the corresponding backbone-identifier, an embedding size, and pretrained=True to the build_backbone method.

You should be able to use any custom face image dataset as long as it shares the necessary method from the data/face_dataset.py. Have a look at the main.py, and you will see that as long as you can somehow provide the number of identities present in your training data, you can use any PyTorch dataset.

I hope that I am not missing something here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants