Skip to content Skip to sidebar Skip to footer

Pickle Error Assert Id(obj) Not In Self.memo

I am using dill (advanced version of pickle) right now. I want to serialize my object, but I get this error: /usr/lib/python2.7/pickle.pyc in memoize(self, obj) 242 if

Solution 1:

Without you posting a reduced version of your code, it's hard to help. However, dill has some builtin detection methods. Look at dill.detect.

>>># trace dill's pickling of objects, by printing out step by step trace >>>dill.detect.trace(True)

Or by object inspection.

>>>dill.detect.badobjects(yourfailingobject, depth=1)

There's also dill.detect.badtypes and so on.

Or you can trace down how objects relate to each other, with dill.detect.parent, dill.detect.children, dill.detect.reference, and so on.

Here's an example of using dill (plus objgraph for visualization) to track down circular references. https://github.com/uqfoundation/dill/issues/58

There's also a big list of all that dill does not know how to serialize in dill._objects -- at least the first 15 sections of the python standard library, plus some others.

Post a Comment for "Pickle Error Assert Id(obj) Not In Self.memo"