multiprocessing.pool.MaybeEncodingError: Error sending result: '<defaultdict object at 0x7f26ced915e0>'. Reason: 'TypeError("cannot pickle 'defaultdict' object")'

问题描述:

使用pool多进程,返回结果使用get函数读取时报错,

原因:

defaultdict类型,pickle无法序列化,在返回函数中需要对返回结果重新转换为dict()即可

posted @ 2023-09-19 10:37  海_纳百川  阅读(90)  评论(0编辑  收藏  举报
本站总访问量