What does "grpc fail : PicklingError: Can't pickle <class 'demo_pb2.msg'>: import of module demo_pb2 failed" mean?

Asked 2 years ago

I got this error after I pickle a function at the top level in my module. It's a nested function call, and it's supposed to work, but it doesn't. Do I need to restructure my code? Thanks.

Memphis Hancock

Monday, October 10, 2022

If you can't pickle the class, it might not be among the list of classes that can be pickled. Consider checking this link to see a list of objects and types that can be pickled. In your case, the problem is probably because the pool queues all the tasks where they're not picklable. Consider slightly restructuring your code.





Write an answer...

Cancel

Please follow our  Community Guidelines

Can't find what you're looking for?