results = opti.solve(instance,tee=True)
pickle.dump(results,open("tmp_results.p","wb"))
And get the following error to console:
Traceback (most recent call last):
File "/Users/anyacastillo/Documents/workspace/ferc/uc/__init__.py", line 39, in <module>
pickle.dump(results,open("tmp_results.p","wb"))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1370, in dump
Pickler(file, protocol).dump(obj)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 224, in dump
self.save(obj)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 306, in save
rv = reduce(self.proto)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.py", line 84, in _reduce_ex
dict = getstate()
File "/Library/Python/2.7/site-packages/coopr/opt/results/results_.py", line 99, in __getstate__
var['canonical_label'] = _canonical_label(sMap.getObject(symbol))
File "/Library/Python/2.7/site-packages/coopr/opt/results/results_.py", line 73, in _canonical_label
elif int(idx) == idx:
TypeError: int() argument must be a string or a number, not 'instancemethod'