torch.save(model, 'best_model.pth') error with opt_level="O1"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9k
- Forks
- 1.5k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 3
Description
Traceback (most recent call last):
File "/home/song/PycharmProjects/RSCDNet/train_amp.py", line 482, in
torch.save(model, '{}/best_model.pth'.format(model_save_dir))
File "/usr/local/lib/python3.5/dist-packages/torch/serialization.py", line 224, in save
return _with_file_like(f, "wb", lambda f: _save(obj, f, pickle_module, pickle_protocol))
File "/usr/local/lib/python3.5/dist-packages/torch/serialization.py", line 149, in _with_file_like
return body(f)
File "/usr/local/lib/python3.5/dist-packages/torch/serialization.py", line 224, in
return _with_file_like(f, "wb", lambda f: _save(obj, f, pickle_module, pickle_protocol))
File "/usr/local/lib/python3.5/dist-packages/torch/serialization.py", line 297, in _save
pickler.dump(obj)
_pickle.PicklingError: Can't pickle <function interpolate at 0x7fcb09251f28>: it's not the same object as torch.nn.functional.interpolate
Process finished with exit code 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the reported torch.save call in train_amp.py and the traceback from torch.serialization.py, then reproduce the failure with opt_level="O1". Confirm whether model saving succeeds without the reported PicklingError; the issue does not identify a repository test or a proposed change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100