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

How to obtain the weights for a specific number of classes #398

Open
Lijingze666 opened this issue Jan 6, 2025 · 1 comment
Open

How to obtain the weights for a specific number of classes #398

Lijingze666 opened this issue Jan 6, 2025 · 1 comment

Comments

@Lijingze666
Copy link

First of all, I would like to sincerely thank you for releasing such an excellent open-source project. I trained a ResNet101 model using 5994 speakers from Vox2 and an additional 200 people, resulting in a class count of 18582 after applying acceleration perturbations. The trained models are saved under the 'models' directory.
For my new task, I want to fine-tune the model using only the data from the 200 people, but I would like to use the pretrained weights (checkpoint) for initialization, rather than initializing the model randomly with model_init. How can I extract the weights for the required 200 classes from the original 18582 classes? Additionally, how are the labels for the pretrained acceleration perturbation defined? Thank you!

@JiJiJiang
Copy link
Collaborator

JiJiJiang commented Jan 8, 2025

How can I extract the weights for the required 200 classes from the original 18582 classes?
=> This could be a little complicated. You need to find out the corresponding indexes of the additional 200 classes (by matching the speaker name in the final sorted training speaker list). Afterwards, getting the corresponding lines/columns of the final fc output layer (matrix of embed_size*N), which may be used as the weights of the required 200 classes.

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