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 self.fast: 243 return --> 244 assert id(obj) not in self.memo 245 memo_len = len(self.memo) 246 self.write(self.put(memo_len)) Can someone tell me the possibility that made this error or how can I solved this? 回答1: Without you posting a reduced version of your code, it's hard to help. However, dill has some builtin detection