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
freeze() doesn't set requires_grad to False #51
Comments
The problem seems to be in the way the parameters are structured. For fastai.vision models learn.opt.param_lists return a count of 3 lists and freeze() deactivates gradients for the first two parameter lists. In tsai models all parameters are in one list. So freeze() works on an empty list.
EDIT: |
My workaround for now, if anyone else wants to use TSBERT / Fine-Tuning
|
Hi @kamisoel, |
Hi @oguiza, |
Hi @kamisoel, |
I will close this issue for lack of response. If the issue persists, please, feel free to re-open. |
Hi @oguiza Just another small request: Would it be possible to allow the use of the XCM model for pre-training as well? It already has a separate head and can be used with TSBert as well |
Hi @kamisoel, I'm glad to hear the issue is now fixed. |
While playing around with the TSBert notebook, I noticed that the models parameters don't seem to get frozen when loading pretrained weights. Even if you call freeze() on the Learner, the parameters do NOT get frozen! I used the count_parameters() method (which as I checked just counts the parameters with requires_grad==True) to confirm this behavior.
Code sample:
The text was updated successfully, but these errors were encountered: