已解决java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Long

已解决java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Long

insert image description here

Article Directory

Error report

I have encountered this pit in my work before, and record the problem and solution. It may not be applicable to all situations, but it can be used for your reference.
The problem description is as follows:

ForkingPickler(file, protocol).dump(obj) TypeError: can’t pickle Environment objects

TypeError: cannot pickle environment object

insert image description here

Solution

insert image description here
T1, move the queue to self instead of as a parameter of function package and send
T2, multiprocessing.Manager().Queue() instead of multiprocessing.Queue

PS

If you have any questions, just leave a message in the comment area

Guess you like

Origin blog.csdn.net/weixin_50843918/article/details/130478974