Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

cPickle.PicklingError: Can't pickle <type 'instancemethod'>: attribute lookup __builtin__.instancemethod failed #92

Open
ghost opened this issue Jan 3, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 3, 2019

Traceback (most recent call last):
File "main.py", line 271, in
model_save(args.save)
File "main.py", line 85, in model_save
torch.save([model,criterion,optimizer], f)
File "/nfs/project/tools/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 209, in save
return _with_file_like(f, "wb", lambda f: _save(obj, f, pickle_module, pickle_protocol))
File "/nfs/project/tools/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 134, in _with_file_like
return body(f)
File "/nfs/project/tools/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 209, in
return _with_file_like(f, "wb", lambda f: _save(obj, f, pickle_module, pickle_protocol))
File "/nfs/project/tools/anaconda2/lib/python2.7/site-packages/torch/serialization.py", line 282, in _save
pickler.dump(obj)

when I run this code, and cause this problem. How should I solve it?

@DavidNemeskey
Copy link

From README.md: "Python 3 and PyTorch 0.4 are required for the current codebase."

Try running it under Python 3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant