-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Expand num_class from pretrained model #111
Comments
Hey! |
same problem! i want to train with many characters and use weight from pretrained model (TPS-RestNet-BiLSTM-Att-case-sensitive.pth) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi everyone,
I want to use the pretrained model "TPS-RestNet-BiLSTM-Att-case-sensitive.pth" and fine tune it with more characters, like '£' or '€' and ' ' (space).
I use the --sensitive custom with my new character set but I got a size mismatch in the attention layer (rnn, weights, and bias) even with the --FT option due to the increase in the cardinal of opt.characters. If I only swap some characters, like '^' -> '£' , everything is still fine.
Is there any simple way to copy the model and only expand the number of target classes, to avoid loosing all the information learned during pre training ? Should I simply reinitialize the attention layer ?
Otherwise I understand I'll have to train from scratch with my custom character list.
Let me know if you need any additional information.
Thanks again for this amazing software !
The text was updated successfully, but these errors were encountered: