We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug
pip (model-compression-toolkit)
1.10.0
Ubuntu 20.04
3.10
torch.save fails with pickling error on mct quantized model
No response
import torch import torchvision as tv import model_compression_toolkit as mct model = tv.models.get_model('alexnet') model.eval() def gen(): yield [torch.rand(1, 3, 224, 224)] qmodel, qinfo = mct.ptq.pytorch_post_training_quantization_experimental(model, gen) torch.save(qmodel, '/tmp/qmodel.pt')
Traceback (most recent call last): File "/Vols/vol_design/tools/swat/users/irenab/ml-frameworks-uni-converter/uni/fx_rename/fx_parser/tests/mct_bug.py", line 37, in <module> torch.save(qmodel, '/tmp/qmodel.pt') File "/data/projects/swat/envs/irenab/py3.10_torch2.0/lib/python3.10/site-packages/torch/serialization.py", line 441, in save _save(obj, opened_zipfile, pickle_module, pickle_protocol) File "/data/projects/swat/envs/irenab/py3.10_torch2.0/lib/python3.10/site-packages/torch/serialization.py", line 653, in _save pickler.dump(obj) _pickle.PicklingError: Can't pickle <function <lambda> at 0x7fb0557251b0>: attribute lookup <lambda> on model_compression_toolkit.core.pytorch.default_framework_info failed
The text was updated successfully, but these errors were encountered:
Fix issue #841: fix MCT so quantized models work with torch.save
6a9e3bb
Fix issue #841: fix MCT so quantized models work with torch.save (#861)
e4ce56d
Co-authored-by: elad cohen <[email protected]>
elad-c
Successfully merging a pull request may close this issue.
Issue Type
Bug
Source
pip (model-compression-toolkit)
MCT Version
1.10.0
OS Platform and Distribution
Ubuntu 20.04
Python version
3.10
Describe the issue
Expected behaviour
No response
Code to reproduce the issue
Log output
The text was updated successfully, but these errors were encountered: