-
Notifications
You must be signed in to change notification settings - Fork 4.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
created original copy of the model by loading from disk #2406
Conversation
✅ Deploy Preview for pytorch-tutorials-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
/assigntome |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work: model_to_quantize will be a dictionary, not a nn.Module, and the next line will fail.
Have you verified it?
I think you need to copy the logic starting with the line 164: create LSTMModel and then use load_state_dict.
# to keep the original model for future comparison | ||
model_to_quantize = copy.deepcopy(model) | ||
|
||
# Load the model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A duplicate comment now?
updated solution not to override the model parameter
model_to_quantize = copy.deepcopy(model) | ||
|
||
|
||
# Load Pretrained Model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is redundant?
Remove redundant comment
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/2406
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit f3e45d9: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
* created original copy of the model by loading from disk * Update fx_graph_mode_ptq_dynamic.py --------- Co-authored-by: Svetlana Karslioglu <svekars@fb.com>
Fixes #2334
Description
updated the deepcopy method , to load the pretrained model from disk to create a copy
Checklist
@docathon-h1-2023 #docathon-h1-2023
@albanD
@svekars
@kit1980
cc @albanD