My problem was that my class assignment was merely a pointer to a pointer that pointed into a file, i.e. the values for my classes were directly read from the disk memory. That caused the pickling to fail. In python, often a variable assignment from another variable is only a new pointer to the same memory, i.e. no new memory is assigned. In my case I had to wrap the iterable dict.keys() in a list. While both return exactly the same values, the list() constructor assigns new memory in RAM.
It might be that you have a similar problem in your pipeline if you read from a csv, xml, json or whatever. Make sure that in your code at one point you make a deep copy of whatever values you read in so that the variables for pickling do not point into the hard disk memory space but in RAM.