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

Using a pretrained model? #1

Closed
fabge opened this issue Mar 24, 2020 · 2 comments
Closed

Using a pretrained model? #1

fabge opened this issue Mar 24, 2020 · 2 comments

Comments

@fabge
Copy link

fabge commented Mar 24, 2020

In the notebook 05_Clan_and_coda_type_detection_with_RNN a pretrained model should be used and is instantiated like so:

learn = Learner(
    dls,
    model_pretrain.Model(),
    metrics=[accuracy_multi],
    loss_func=BCEWithLogitsLossFlat()
)

How are the weights from the pretrained model loaded? As far as I can see, only the architecture is used with model_pretrain.Model(), without any pretrained weights or am I missing something?

@radekosmulski
Copy link
Contributor

Hi Fabian! Thank you very much for looking at the code and being on the lookout for potential issues, appreciate it.

At the top of the notebook, I train with preloading the weights:
image

Later on, I run an experiment as you note with only recreating the architecture, but not loading the pretrained weights. I still get the same result.

I reworded the text a little bit so hoping the narrative will work better now. But if you do see something off or there is still something that is not clear here, please let me know!

Thank you again for looking at this and for your comment!

@fabge
Copy link
Author

fabge commented Mar 24, 2020

Oh I see! I probably got the with and without pretrained part mixed up due to the "Does pretraining help?" heading.
Thank you for clarifying and improving the text and for doing what you do 😄!

@fabge fabge closed this as completed Mar 24, 2020
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