CASIA-IVA-Lab / FLAP

[AAAI 2024] Fluctuation-based Adaptive Structured Pruning for Large Language Models
https://arxiv.org/abs/2312.11983
Apache License 2.0
30 stars 4 forks source link

AttributeError: Can't pickle local object 'add_hook_to_module.<locals>.new_forward' #9

Open shwu-nyunai opened 3 months ago

shwu-nyunai commented 3 months ago

Traceback (most recent call last): File "/home/shwu/LABS/FLAP/main.py", line 147, in main() File "/home/shwu/LABS/FLAP/main.py", line 141, in main torch.save(model, f'{args.save_model}/pruned_model.pt') File "/home/shwu/LABS/FLAP/venv/lib/python3.10/site-packages/torch/serialization.py", line 629, in save _save(obj, opened_zipfile, pickle_module, pickle_protocol, _disable_byteorder_record) File "/home/shwu/LABS/FLAP/venv/lib/python3.10/site-packages/torch/serialization.py", line 841, in _save pickler.dump(obj) AttributeError: Can't pickle local object 'add_hook_to_module..new_forward'


this occurs after pruning on multiple gpus and saving with torch.save