I am using a Multiprocessing pool to train machine learners.
Each LearnerRun object gets a learner, a dictionary of hyperparameters, a name, some more options in an other options dictionary, the name of a directory to write results to, a set of IDs of examples to train on (a slice or numpy array), and a set of IDs of examples to test on (also a slice or numpy array). Importantly, the training and testing data are not read yet: The sets of IDs are relatively small and direct a later function's database-reading behavior.
I call self.pool.apply_async(learner_run.run)
, which formerly worked fine. Now the pool seems to be loaded up, but a print statement at the top of the run() function is never printed, so the processes are not actually getting run.
I've tracked down some other threads about this and found that I can see the problem in more detail with handler = self.pool.apply_async(learner_run.run)
followed by handler.get()
. This prints "SystemError: NULL result without error in PyObject_Call".
Great, something I can Google. But all I can find on this issue with Multiprocessing is that it can be caused when passing arguments that are too big to pickle to the subprocess. But, I am obviously passing no arguments to my subprocess. So what gives?
What else, aside from arguments exceeding the allotted memory size--which I am reasonably sure is not the problem here--can cause apply_async to give a null result?
Again, this worked before I left for vacation and hasn't been changed. What kinds of changes to other code might cause this to stop working?
If I do not try to get()
from the handler so execution doesn't stop on errors, the memory usage follows this strange pattern.