已解决java.lang.ClassCastException: class java.lang.Integer cannot be cast to class java.lang.Long
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
Solution
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